Documentation ¶
Index ¶
- func New(cfg Config, metrics httpMetrics) *client
- type Config
- type RequestCtx
- type RequestOption
- func WithBasicAuth(login, pass string) RequestOption
- func WithBearerAuth(token string) RequestOption
- func WithContentType(contentType string) RequestOption
- func WithHeader(key, value string) RequestOption
- func WithHmacAuth(client, key string) RequestOption
- func WithHmacSha256Auth(client, key string) RequestOption
- func WithPathTransformer(transform func(path string) string) RequestOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type RequestCtx ¶
type RequestCtx struct {
// contains filtered or unexported fields
}
type RequestOption ¶
type RequestOption func(request *RequestCtx)
func WithBasicAuth ¶
func WithBasicAuth(login, pass string) RequestOption
func WithBearerAuth ¶
func WithBearerAuth(token string) RequestOption
func WithContentType ¶
func WithContentType(contentType string) RequestOption
func WithHeader ¶
func WithHeader(key, value string) RequestOption
func WithHmacAuth ¶
func WithHmacAuth(client, key string) RequestOption
func WithHmacSha256Auth ¶
func WithHmacSha256Auth(client, key string) RequestOption
func WithPathTransformer ¶
func WithPathTransformer(transform func(path string) string) RequestOption
WithPathTransformer applies transform to request path before writing metrics It's critical for preventing prometheus labels filling with dynamic paths like /api/v1/user/123/transaction/41234
Click to show internal directories.
Click to hide internal directories.