Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type APIError ¶
type APIError struct {
StatusCode int `json:"-"`
// contains filtered or unexported fields
}
APIError is a lightweight wrapper around the standard error interface that preserves the status code from the RPC, if any.
func NewAPIError ¶
NewAPIError constructs a new API error.
type ClientOption ¶
type ClientOption func(*ClientOptions)
ClientOption adapts the behavior of the generated client.
type ClientOptions ¶
type ClientOptions struct {
BaseURL string
HTTPClient HTTPClient
HTTPHeader http.Header
Token string
}
ClientOptions defines all of the possible client options. This type is primarily used by the generated code and is not meant to be used directly; use ClientOption instead.
func NewClientOptions ¶
func NewClientOptions() *ClientOptions
NewClientOptions returns a new *ClientOptions value. This function is primarily used by the generated code and is not meant to be used directly; use ClientOption instead.
func (*ClientOptions) ToHeader ¶
func (c *ClientOptions) ToHeader() http.Header
ToHeader maps the configured client options into a http.Header issued on every request.
type ErrorDecoder ¶
ErrorDecoder decodes *http.Response errors and returns a typed API error (e.g. *APIError).