Documentation ¶
Index ¶
- type HttpClient
- func (c *HttpClient) Do(ctx context.Context, method string) (*HttpResponse, error)
- func (c *HttpClient) DoFormEncoding(ctx context.Context, method string) (*HttpResponse, error)
- func (c *HttpClient) DoFormMultipart(ctx context.Context) (*HttpResponse, error)
- func (c *HttpClient) URL() string
- func (c *HttpClient) WithBasicAuth(username string, password string) *HttpClient
- func (c *HttpClient) WithBearerAuth(token string, addPrefix bool) *HttpClient
- func (c *HttpClient) WithHeaders(headers map[string]string) *HttpClient
- func (c *HttpClient) WithPayload(params interface{}) *HttpClient
- func (c *HttpClient) WithUrl(uri string, params map[string][]string) *HttpClient
- type HttpExecutor
- type HttpResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HttpClient ¶
type HttpClient struct {
// contains filtered or unexported fields
}
func NewHttpClient ¶
func NewHttpClient(httpExecutor HttpExecutor, timeout time.Duration) *HttpClient
func NewRetryHttpClient ¶
func NewRetryHttpClient(httpExecutor HttpExecutor, timeout time.Duration, retry uint64) *HttpClient
func (*HttpClient) Do ¶
func (c *HttpClient) Do(ctx context.Context, method string) (*HttpResponse, error)
func (*HttpClient) DoFormEncoding ¶
func (c *HttpClient) DoFormEncoding(ctx context.Context, method string) (*HttpResponse, error)
func (*HttpClient) DoFormMultipart ¶
func (c *HttpClient) DoFormMultipart(ctx context.Context) (*HttpResponse, error)
func (*HttpClient) URL ¶
func (c *HttpClient) URL() string
func (*HttpClient) WithBasicAuth ¶
func (c *HttpClient) WithBasicAuth(username string, password string) *HttpClient
func (*HttpClient) WithBearerAuth ¶
func (c *HttpClient) WithBearerAuth(token string, addPrefix bool) *HttpClient
func (*HttpClient) WithHeaders ¶
func (c *HttpClient) WithHeaders(headers map[string]string) *HttpClient
func (*HttpClient) WithPayload ¶
func (c *HttpClient) WithPayload(params interface{}) *HttpClient
func (*HttpClient) WithUrl ¶
func (c *HttpClient) WithUrl(uri string, params map[string][]string) *HttpClient
type HttpExecutor ¶
type HttpExecutor interface { Execute(r *http.Request, timeout time.Duration, retry uint64) (int, []byte, error) WithPrometheusHttpConfig(conf *u_prometheus.HttpConfig) HttpExecutor }
func NewHttpExecutor ¶
func NewHttpExecutor() HttpExecutor
type HttpResponse ¶ added in v1.1.7
Click to show internal directories.
Click to hide internal directories.