core

package
v0.0.79 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 6, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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

func NewAPIError(statusCode int, err error) *APIError

NewAPIError constructs a new API error.

func (*APIError) Error

func (a *APIError) Error() string

Error returns the API error's message.

func (*APIError) Unwrap

func (a *APIError) Unwrap() error

Unwrap returns the underlying error. This also makes the error compatible with errors.As and errors.Is.

type BaseURLOption

type BaseURLOption struct {
	BaseURL string
}

BaseURLOption implements the RequestOption interface.

type BodyPropertiesOption added in v0.0.21

type BodyPropertiesOption struct {
	BodyProperties map[string]interface{}
}

BodyPropertiesOption implements the RequestOption interface.

type HTTPClient

type HTTPClient interface {
	Do(*http.Request) (*http.Response, error)
}

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

type HTTPHeaderOption struct {
	HTTPHeader http.Header
}

HTTPHeaderOption implements the RequestOption interface.

type MaxAttemptsOption

type MaxAttemptsOption struct {
	MaxAttempts uint
}

MaxAttemptsOption implements the RequestOption interface.

type QueryParametersOption added in v0.0.21

type QueryParametersOption struct {
	QueryParameters url.Values
}

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
}

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).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL