Documentation
¶
Index ¶
- func NewDefaultHttpClient(defaultEntry logger.Entry, timeout time.Duration) *http.Client
- func NewHttpClientWithMiddlewares(timeout time.Duration, middlewares ...middleware.Middleware) *http.Client
- func WithHeaderSetterFn(setterFn HeaderSetterFn) option
- func WithResponseParser(p ResponseParser) option
- func WithTimeout(timeout time.Duration) option
- func WithTransport(rt http.RoundTripper) option
- type ApiResponse
- type BaseClient
- type DefaultApiResponseParser
- type Error
- type HeaderSetterFn
- type ResponseParser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDefaultHttpClient ¶
func NewHttpClientWithMiddlewares ¶
func NewHttpClientWithMiddlewares(timeout time.Duration, middlewares ...middleware.Middleware) *http.Client
func WithResponseParser ¶
func WithResponseParser(p ResponseParser) option
WithResponseParser custom response parsing format
func WithTransport ¶
func WithTransport(rt http.RoundTripper) option
WithTransport custom transport option
Types ¶
type ApiResponse ¶
type ApiResponse struct {
Data interface{} `json:"data"`
}
ApiResponse data structure to extract restful response
type BaseClient ¶
type BaseClient struct {
// contains filtered or unexported fields
}
func NewBaseClient ¶
func NewBaseClient(url string, opts ...option) *BaseClient
type DefaultApiResponseParser ¶
type DefaultApiResponseParser struct{}
type HeaderSetterFn ¶
type ResponseParser ¶
Click to show internal directories.
Click to hide internal directories.