client

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2026 License: MIT Imports: 16 Imported by: 5

Documentation

Index

Constants

View Source
const (
	DefaultRequestMethod = http.MethodGet
)

Variables

This section is empty.

Functions

func NewRequestHeader

func NewRequestHeader(key, value string) requestHeader

Types

type Manager added in v0.4.0

type Manager interface {
	SetCore(core *fasthttp.Client) Manager
	SetTelemetryManager(telemetry telemetry.Manager) Manager
	Request(url string, opts ...RequestOption) (*response, error)
}

func New

func New(opts ...Option) Manager

type Option

type Option func(*client)

func WithCore

func WithCore(core *fasthttp.Client) Option

func WithCoreOptions

func WithCoreOptions(opts ...core.Option) Option

func WithTelemetryManager

func WithTelemetryManager(telemetry telemetry.Manager) Option

type RequestOption

type RequestOption func(*request)

func WithRequestBody

func WithRequestBody(body []byte) RequestOption

func WithRequestContext

func WithRequestContext(context context.Context) RequestOption

func WithRequestHeaders

func WithRequestHeaders(headers ...requestHeader) RequestOption

func WithRequestJsonBody

func WithRequestJsonBody(data any) RequestOption

WithRequestJsonBody serializes the given data to JSON and returns a RequestOption that sets it as the request body.

If serialization fails, the function logs the error and immediately terminates the program with exit code 65 (ExitDataError), indicating invalid input data.

func WithRequestMethod

func WithRequestMethod(method string) RequestOption

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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