core

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2026 License: MIT Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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:"-"`
	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

func NewAPIError(statusCode int, header http.Header, 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

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

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
	MaxBufSize                 int
	MaxStreamReconnectAttempts uint
	DisableStreamReconnection  bool
	DisableRetries             bool
	Token                      string
	TokenFunc                  func() (string, error)
}

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 Response

type Response[T any] struct {
	StatusCode int
	Header     http.Header
	Body       T
}

Response is an HTTP response from an HTTP client.

type TokenFuncOption

type TokenFuncOption struct {
	TokenFunc func() (string, error)
}

TokenFuncOption implements the RequestOption interface.

type TokenOption

type TokenOption struct {
	Token string
}

TokenOption implements the RequestOption interface.

type WithoutRetriesOption

type WithoutRetriesOption struct{}

WithoutRetriesOption implements the RequestOption interface.

type WithoutStreamReconnectionOption

type WithoutStreamReconnectionOption struct{}

WithoutStreamReconnectionOption implements the RequestOption interface.

Jump to

Keyboard shortcuts

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