client

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2026 License: MIT Imports: 15 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 MockManager added in v0.11.0

type MockManager struct {
	mock.Mock
}

MockManager is an autogenerated mock type for the Manager type

func NewMockManager added in v0.11.0

func NewMockManager(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockManager

NewMockManager creates a new instance of MockManager. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockManager) EXPECT added in v0.11.0

func (_m *MockManager) EXPECT() *MockManager_Expecter

func (*MockManager) Request added in v0.11.0

func (_mock *MockManager) Request(url string, opts ...RequestOption) (*response, error)

Request provides a mock function for the type MockManager

func (*MockManager) SetCore added in v0.11.0

func (_mock *MockManager) SetCore(core *fasthttp.Client) Manager

SetCore provides a mock function for the type MockManager

func (*MockManager) SetTelemetryManager added in v0.11.0

func (_mock *MockManager) SetTelemetryManager(telemetry1 telemetry.Manager) Manager

SetTelemetryManager provides a mock function for the type MockManager

type MockManager_Expecter added in v0.11.0

type MockManager_Expecter struct {
	// contains filtered or unexported fields
}

func (*MockManager_Expecter) Request added in v0.11.0

func (_e *MockManager_Expecter) Request(url interface{}, opts ...interface{}) *MockManager_Request_Call

Request is a helper method to define mock.On call

  • url string
  • opts ...RequestOption

func (*MockManager_Expecter) SetCore added in v0.11.0

func (_e *MockManager_Expecter) SetCore(core interface{}) *MockManager_SetCore_Call

SetCore is a helper method to define mock.On call

  • core *fasthttp.Client

func (*MockManager_Expecter) SetTelemetryManager added in v0.11.0

func (_e *MockManager_Expecter) SetTelemetryManager(telemetry1 interface{}) *MockManager_SetTelemetryManager_Call

SetTelemetryManager is a helper method to define mock.On call

  • telemetry1 telemetry.Manager

type MockManager_Request_Call added in v0.11.0

type MockManager_Request_Call struct {
	*mock.Call
}

MockManager_Request_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Request'

func (*MockManager_Request_Call) Return added in v0.11.0

func (_c *MockManager_Request_Call) Return(responseMoqParam *response, err error) *MockManager_Request_Call

func (*MockManager_Request_Call) Run added in v0.11.0

func (_c *MockManager_Request_Call) Run(run func(url string, opts ...RequestOption)) *MockManager_Request_Call

func (*MockManager_Request_Call) RunAndReturn added in v0.11.0

func (_c *MockManager_Request_Call) RunAndReturn(run func(url string, opts ...RequestOption) (*response, error)) *MockManager_Request_Call

type MockManager_SetCore_Call added in v0.11.0

type MockManager_SetCore_Call struct {
	*mock.Call
}

MockManager_SetCore_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetCore'

func (*MockManager_SetCore_Call) Return added in v0.11.0

func (*MockManager_SetCore_Call) Run added in v0.11.0

func (*MockManager_SetCore_Call) RunAndReturn added in v0.11.0

func (_c *MockManager_SetCore_Call) RunAndReturn(run func(core *fasthttp.Client) Manager) *MockManager_SetCore_Call

type MockManager_SetTelemetryManager_Call added in v0.11.0

type MockManager_SetTelemetryManager_Call struct {
	*mock.Call
}

MockManager_SetTelemetryManager_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetTelemetryManager'

func (*MockManager_SetTelemetryManager_Call) Return added in v0.11.0

func (*MockManager_SetTelemetryManager_Call) Run added in v0.11.0

func (*MockManager_SetTelemetryManager_Call) RunAndReturn added in v0.11.0

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

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