http

package
v0.0.0-...-b4a335c Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2026 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const NeverTimeout = time.Duration(-1)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func New

func New(opts ...ClientOption) *Client

func (*Client) Request

func (d *Client) Request(method, url string, opts ...Option) (*http.Response, error)

type ClientOption

type ClientOption func(*http.Client)

func WithClientTimeout

func WithClientTimeout(timeout time.Duration) ClientOption

type Option

type Option func(*option) error

func WithBody

func WithBody(body io.Reader) Option

func WithContext

func WithContext(ctx context.Context) Option

func WithForm

func WithForm(data map[string]string) Option

func WithHeaders

func WithHeaders(headers map[string]string) Option

func WithHost

func WithHost(host string) Option

func WithJson

func WithJson(data interface{}) Option

func WithNeverTimeout

func WithNeverTimeout() Option

func WithQueryParams

func WithQueryParams(data map[string]string) Option

func WithRequest

func WithRequest(reqFunc func(req *http.Request)) Option

func WithTimeout

func WithTimeout(timeout time.Duration) Option

Jump to

Keyboard shortcuts

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