client

package
v2.167.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NoOptions = &Options{}

NoOptions for http.

Functions

This section is empty.

Types

type Client

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

Client for http.

func NewClient

func NewClient(content *content.Content, pool *sync.BufferPool, opts ...ClientOption) *Client

NewClient for http.

func (*Client) Delete

func (c *Client) Delete(ctx context.Context, url string, opts *Options) error

Delete the url.

func (*Client) Do

func (c *Client) Do(ctx context.Context, method, url string, opts *Options) error

Do with method and url.

func (*Client) Get

func (c *Client) Get(ctx context.Context, url string, opts *Options) error

Get the url.

func (*Client) Patch

func (c *Client) Patch(ctx context.Context, url string, opts *Options) error

Patch the url.

func (*Client) Post

func (c *Client) Post(ctx context.Context, url string, opts *Options) error

Post the url.

func (*Client) Put

func (c *Client) Put(ctx context.Context, url string, opts *Options) error

Put the url.

type ClientOption

type ClientOption interface {
	// contains filtered or unexported methods
}

ClientOption for http.

func WithIgnoreRedirect added in v2.21.0

func WithIgnoreRedirect() ClientOption

WithIgnoreRedirect for http.

func WithRoundTripper

func WithRoundTripper(rt http.RoundTripper) ClientOption

WithRoundTripper for http.

func WithTimeout

func WithTimeout(timeout time.Duration) ClientOption

WithTimeout for http.

type Options

type Options struct {
	Request     any
	Response    any
	ContentType string
}

Options for client.

func (*Options) HasRequest added in v2.21.0

func (o *Options) HasRequest() bool

HasRequest for options.

func (*Options) HasResponse added in v2.21.0

func (o *Options) HasResponse() bool

HasResponse for options.

Jump to

Keyboard shortcuts

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