Versions in this module Expand all Collapse all v0 v0.0.1 Dec 25, 2024 Changes in this version + const DefaultContentType + var ErrStopStreaming = errors.New("stop streaming") + type Authorizer func(*http.Request) error + func BearerTokenAuthorizer(token string) Authorizer + type Callback func([]byte) error + type Client struct + Authorize func(*http.Request) error + BaseURL string + HTTPClient *http.Client + Log LogFunc + LogMask LogTag + func (c *Client) Call(ctx context.Context, req *Request) (http.Header, []byte, error) + func (c *Client) Stream(ctx context.Context, req *Request, f Callback) error + type Error struct + Data []byte + Err error + Message string + Status int + func (e *Error) Error() string + func (e *Error) Unwrap() error + type LogFunc func(tag LogTag, message string) + type LogTag int + const LogAuthorization + const LogHTTPStatus + const LogRequestURL + const LogResponseBody + const LogStreamBody + func (t LogTag) String() string + type Params map[string][]string + func (p Params) Add(name string, values ...string) + func (p Params) Encode() string + func (p Params) Reset(name string) + func (p Params) Set(name, value string) + type Request struct + ContentType string + Data []byte + HTTPMethod string + Method string + Params Params + func (r *Request) Body() (data io.Reader, size int64, ctype string) + func (r *Request) SetBodyToParams() + func (r *Request) URL(base string) (string, error)