http

package
v0.0.0-...-cf015e3 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: MIT Imports: 2 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(options ...ClientOption) *Client

NewClient returns a new http.Client with a default timeout.

func (*Client) Do

func (c *Client) Do(req *http.Request) (*http.Response, error)

type ClientOption

type ClientOption func(*clientOptions)

A ClientOption is a functional option.

func WithClientTimeout

func WithClientTimeout(timeout time.Duration) ClientOption

WithClientTimeout sets the client timeout.

func WithUserAgent

func WithUserAgent(useragent string) ClientOption

WithUserAgent sets the client user-agent.

Jump to

Keyboard shortcuts

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