Versions in this module Expand all Collapse all v0 v0.1.0 Nov 28, 2023 Changes in this version + var DefaultTransport = NewTransporter(JsonRequest{}, http.DefaultTransport, JsonResponse{}) + var NameMayNotBe = []string + var NameMayNotContain = []string + func ErrorFunc(expectStatusCode int) func(*http.Response) error + func IsValidPathSegmentName(name string) []string + func NewRESTClient(transport Transport, method string) *restfulClient + func OnRetryCondition(resp *http.Response, err error) bool + type Handler interface + Endpoint func(endpoint string) Handler + Resource func(resource string) Handler + To func() Transport + func NewHandler() Handler + type JsonRequest struct + func (j JsonRequest) Build(ctx context.Context, method string, url string, body interface{}, ...) (*http.Request, error) + type JsonResponse struct + func (j JsonResponse) Parse(resp *http.Response, result interface{}, opts ...func(*http.Response) error) error + type Logger interface + Debugf func(format string, v ...interface{}) + Errorf func(format string, v ...interface{}) + Infof func(format string, v ...interface{}) + Warnf func(format string, v ...interface{}) + func Nop(context.Context) Logger + type MockRoundTripper struct + func NewMockRoundTripper(ctrl *gomock.Controller) *MockRoundTripper + func (m *MockRoundTripper) EXPECT() *MockRoundTripperMockRecorder + func (m *MockRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) + type MockRoundTripperMockRecorder struct + func (mr *MockRoundTripperMockRecorder) RoundTrip(req interface{}) *gomock.Call + type RESTClient interface + Body func(obj interface{}) RESTClient + Do func(ctx context.Context, result interface{}, opts ...func(*http.Response) error) error + DoNop func(ctx context.Context, opts ...func(*http.Response) error) error + DoRaw func(ctx context.Context) ([]byte, error) + Endpoints func(endpoint string) RESTClient + Header func(key string, values ...string) RESTClient + Headers func(header http.Header) RESTClient + Name func(resourceName string) RESTClient + Prefix func(segments ...string) RESTClient + Query func(key string, value ...string) RESTClient + Querys func(value interface{}) RESTClient + Resource func(resource string) RESTClient + Retry func(backoff backoff.BackOff, shouldRetryFunc func(*http.Response, error) bool) RESTClient + Stream func(ctx context.Context) (io.ReadCloser, error) + SubResource func(subResources ...string) RESTClient + Suffix func(segments ...string) RESTClient + func Delete() RESTClient + func Get() RESTClient + func Method(method string) RESTClient + func Patch() RESTClient + func Post() RESTClient + func Put() RESTClient + type Requester interface + Build func(ctx context.Context, method, url string, body interface{}, headers http.Header) (*http.Request, error) + type Response interface + Parse func(resp *http.Response, result interface{}, opts ...func(*http.Response) error) error + type Transport interface + Client func() http.RoundTripper + Method func(string) RESTClient + Request func() Requester + Response func() Response + WithClient func(roundTripper http.RoundTripper) Transport + WithRequest func(requester Requester) Transport + WithResponse func(response Response) Transport + func NewTransporter(req Requester, roundTripper http.RoundTripper, resp Response) Transport