Versions in this module Expand all Collapse all v1 v1.0.0 Aug 27, 2026 Changes in this version + func GetRequestID(ctx context.Context) string + func WithRequestID(ctx context.Context, id string) context.Context + type CircuitBreaker struct + func NewCircuitBreaker(threshold int, reset time.Duration) *CircuitBreaker + func (c *CircuitBreaker) Allow() bool + func (c *CircuitBreaker) RecordFailure() + func (c *CircuitBreaker) RecordSuccess() + func (c *CircuitBreaker) State() int + type Client struct + func NewClient(baseURL, token string, log *logger.Logger) *Client + func (c *Client) Breaker() *CircuitBreaker + func (c *Client) Close() error + func (c *Client) DownloadFile(ctx context.Context, filePath string) (io.ReadCloser, error) + func (c *Client) Request(ctx context.Context, method string) (*Response, error) + func (c *Client) RequestWithForm(ctx context.Context, method string, form map[string]string, ...) (*Response, error) + func (c *Client) RequestWithMultipart(ctx context.Context, method string, fields map[string]string, ...) (*Response, error) + func (c *Client) RequestWithParams(ctx context.Context, method string, params interface{}) (*Response, error) + func (c *Client) SetHTTPClient(hc *http.Client) + func (c *Client) SetTimeout(d time.Duration) + func (c *Client) Stats() *Stats + func (c *Client) StatsSnapshot() StatsSnapshot + func (c *Client) UserAgent() string + type Response struct + Description string + ErrorCode int + HTTPStatus int + Ok bool + Parameters interface{} + Result json.RawMessage + func (r *Response) AsBool() (bool, error) + func (r *Response) Decode(v interface{}) error + func (r *Response) ParametersAsRetryAfter() int + type Stats struct + BytesIn int64 + BytesOut int64 + ErrorCount int64 + Requests int64 + SuccessCount int64 + func (s *Stats) AvgLatency() time.Duration + func (s *Stats) Record(latency time.Duration, success bool, bytesIn, bytesOut int64) + func (s *Stats) Snapshot() StatsSnapshot + type StatsSnapshot struct + AvgLatency time.Duration + BytesIn int64 + BytesOut int64 + ErrorCount int64 + Requests int64 + SuccessCount int64