client

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Client http.Client
	// contains filtered or unexported fields
}

func New

func New(opts ...Option) (*Client, error)

func (*Client) Configure

func (c *Client) Configure(opts ...Option) error

func (*Client) CtxDo

func (c *Client) CtxDo(
	ctx context.Context, req *request.Request,
) (func(), *response.Response, error)

func (*Client) Use added in v0.2.0

func (c *Client) Use(mw Middleware)

Use appends the passed middleware to the end of the list

func (*Client) UseIndex added in v0.2.0

func (c *Client) UseIndex(mw Middleware, idx int)

type Handler added in v0.2.0

type Handler = func(*RequestCtx) error

type Middleware added in v0.2.0

type Middleware = func(next Handler) Handler

type Option

type Option func(*Client) error

type RequestCtx added in v0.2.0

type RequestCtx struct {
	context.Context
	Error    error
	Request  *request.Request
	Response *response.Response
}

func (*RequestCtx) Done added in v0.2.0

func (rc *RequestCtx) Done()

Done recycles the resources used by request context, after calling this function, the request context MUST NOT be used again.

Jump to

Keyboard shortcuts

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