Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HTTPClientBuilder ¶
type HTTPClientBuilder interface { SetConfig(conf configuration.Config) HTTPClientBuilder AddInterceptors(...HTTPClientInterceptor) HTTPClientBuilder WithPreconfiguredClient(*http.Client) HTTPClientBuilder Build() (HttpClient, error) }
HTTPClientBuilder is a builder interface to build http.Client with interceptors
type HTTPClientInterceptor ¶
HTTPClientInterceptor is a user defined function that can alter a request before it's sent and/or alter a response before it's returned to the caller
type HTTPHandler ¶
HTTPHandler is just an alias to http.RoundTriper.RoundTrip function
type HttpClient ¶
type HttpClient interface { InternalClient Post(c context.Context, payload interface{}, host, handler string, target interface{}, headers map[string]string) servicereply.ServiceReply Get(c context.Context, host, handler string, target interface{}, headers map[string]string) servicereply.ServiceReply ExternalGet(c context.Context, host, handler string, payload map[string]string, target interface{}, headers map[string]string, contentType string) servicereply.ServiceReply Put(c context.Context, payload interface{}, host, handler string, target interface{}, headers map[string]string) servicereply.ServiceReply Delete(c context.Context, host, handler string, target interface{}, headers map[string]string) servicereply.ServiceReply PostForm(c context.Context, uri string, postData, headers map[string]string) ([]byte, servicereply.ServiceReply) SetDiscoveryServiceProvider(dsp discoveryService.DiscoveryServiceProvider) }
type InternalClient ¶
type InternalClient interface {
Call(c context.Context, payload interface{}, host, handler string, target interface{}, headers map[string]string) servicereply.ServiceReply
}
type NewHTTPClientBuilder ¶
type NewHTTPClientBuilder func() HTTPClientBuilder
NewHTTPClientBuilder REST HTTP builder
Useful when you want to create several *http.Client with different options
Click to show internal directories.
Click to hide internal directories.