Documentation
¶
Index ¶
- type APIError
- type APIKeyOption
- type BaseURLOption
- type BodyPropertiesOption
- type HTTPClient
- type HTTPClientOption
- type HTTPHeaderOption
- type MaxAttemptsOption
- type MaxBufSizeOption
- type MaxStreamReconnectAttemptsOption
- type QueryParametersOption
- type RequestOption
- type RequestOptions
- type Response
- type WithoutRetriesOption
- type WithoutStreamReconnectionOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIError ¶
type APIError struct {
StatusCode int `json:"-"`
Header http.Header `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 APIKeyOption ¶
type APIKeyOption struct {
APIKey string
}
APIKeyOption implements the RequestOption interface.
type BaseURLOption ¶
type BaseURLOption struct {
BaseURL string
}
BaseURLOption implements the RequestOption interface.
type BodyPropertiesOption ¶
type BodyPropertiesOption struct {
BodyProperties map[string]interface{}
}
BodyPropertiesOption implements the RequestOption interface.
type HTTPClient ¶
HTTPClient is an interface for a subset of the *http.Client.
type HTTPClientOption ¶
type HTTPClientOption struct {
HTTPClient HTTPClient
}
HTTPClientOption implements the RequestOption interface.
type HTTPHeaderOption ¶
HTTPHeaderOption implements the RequestOption interface.
type MaxAttemptsOption ¶
type MaxAttemptsOption struct {
MaxAttempts uint
}
MaxAttemptsOption implements the RequestOption interface.
type MaxBufSizeOption ¶
type MaxBufSizeOption struct {
MaxBufSize int
}
MaxBufSizeOption implements the RequestOption interface.
type MaxStreamReconnectAttemptsOption ¶
type MaxStreamReconnectAttemptsOption struct {
MaxStreamReconnectAttempts uint
}
MaxStreamReconnectAttemptsOption implements the RequestOption interface.
type QueryParametersOption ¶
QueryParametersOption implements the RequestOption interface.
type RequestOption ¶
type RequestOption interface {
// contains filtered or unexported methods
}
RequestOption adapts the behavior of the client or an individual request.
type RequestOptions ¶
type RequestOptions struct {
BaseURL string
HTTPClient HTTPClient
HTTPHeader http.Header
BodyProperties map[string]interface{}
QueryParameters url.Values
MaxAttempts uint
MaxBufSize int
MaxStreamReconnectAttempts uint
DisableStreamReconnection bool
DisableRetries bool
APIKey string
}
RequestOptions defines all of the possible request options.
This type is primarily used by the generated code and is not meant to be used directly; use the option package instead.
func NewRequestOptions ¶
func NewRequestOptions(opts ...RequestOption) *RequestOptions
NewRequestOptions returns a new *RequestOptions value.
This function is primarily used by the generated code and is not meant to be used directly; use RequestOption instead.
func (*RequestOptions) ToHeader ¶
func (r *RequestOptions) ToHeader() http.Header
ToHeader maps the configured request options into a http.Header used for the request(s).
type WithoutRetriesOption ¶
type WithoutRetriesOption struct{}
WithoutRetriesOption implements the RequestOption interface.
type WithoutStreamReconnectionOption ¶
type WithoutStreamReconnectionOption struct{}
WithoutStreamReconnectionOption implements the RequestOption interface.