Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthorizationOptions ¶
type AuthorizationOptions interface {
Bearer() string
SetBearer(bearer string)
Basic() BasicAuthorizationOptions
SetBasic(basic BasicAuthorizationOptions)
}
type Client ¶
type Client interface {
Get(urlString string, options ...RequestOption) (Response, error)
Post(urlString string, body any, options ...RequestOption) (Response, error)
Put(urlString string, body any, options ...RequestOption) (Response, error)
Patch(urlString string, body any, options ...RequestOption) (Response, error)
Delete(urlString string, options ...RequestOption) (Response, error)
Request(method string, urlString string, options ...RequestOption) (Response, error)
RequestStream(method string, urlString string, options ...RequestOption) (StreamResponse, error)
}
type RequestOption ¶
type RequestOption func(RequestOptions)
type RequestOptions ¶
type RequestOptions interface {
Headers() map[string]string
Query() map[string]string
Body() any
ContentType() string
Timeout() time.Duration
Authorization() AuthorizationOptions
MaxResponseBodyBytes() int
SetMaxResponseBodyBytes(maxResponseBodyBytes int)
SetHeader(key string, value string)
SetHeaders(headers map[string]string)
SetQuery(key string, value string)
SetQueryParams(parameters map[string]string)
SetBody(body any)
SetJson(data any)
SetTimeout(timeout time.Duration)
SetBearerToken(token string)
SetBasicAuth(username string, password string)
}
type StreamResponse ¶
Click to show internal directories.
Click to hide internal directories.