httpclient

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(conf Config)

Types

type Config

type Config struct {
	MaxIdleConns        int `toml:"max_idle_conns"`
	MaxIdleConnsPerHost int `toml:"max_idle_conns_per_host"`
	IdleConnTimeout     int `toml:"idle_conn_timeout"`
}

type Requester

type Requester struct {
	*http.Request
}

func NewRequester

func NewRequester(method, host string, data []byte) (*Requester, error)
method

"GET" ; Section 9.3 "HEAD" ; Section 9.4 "POST" ; Section 9.5 "PUT" ; Section 9.6 "DELETE" ; Section 9.7 "TRACE" ; Section 9.8 "CONNECT" ; Section 9.9

func (*Requester) Do

func (r *Requester) Do(ctx context.Context, timeout time.Duration) ([]byte, error)

func (*Requester) SetHeaders

func (r *Requester) SetHeaders(headers map[string]string)

Jump to

Keyboard shortcuts

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