agent

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

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

func NewAgent

func NewAgent(client *resty.Client, host *url.URL) *Agent

func (*Agent) Debug

func (a *Agent) Debug() *Agent

func (*Agent) Request

func (a *Agent) Request(ctx context.Context, method, uri string, opts ...Option) (b Binder)

func (*Agent) SetAccepter

func (a *Agent) SetAccepter(accepter func(resp *resty.Response) (err error))

func (*Agent) SetLogger

func (a *Agent) SetLogger(logger *logger.Logger)

type Binder

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

func (Binder) Bind

func (b Binder) Bind(ptr any) error

func (Binder) Error

func (b Binder) Error() error

type Option

type Option func(r *options)

func WithAfterRequest

func WithAfterRequest(fn func(req *resty.Request) error) Option

func WithRequestBody

func WithRequestBody(body any) Option

func WithRequestHeader

func WithRequestHeader(h map[string]string) Option

func WithRequestInjector

func WithRequestInjector(fn func(req *resty.Request) error) Option

func WithResponseFilter

func WithResponseFilter(fn func(resp *resty.Response) (data []byte, err error)) Option

Jump to

Keyboard shortcuts

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