httpclient

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2022 License: Apache-2.0 Imports: 11 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 {
	*Options
	// contains filtered or unexported fields
}

func NewClient

func NewClient(options Options) (*Client, error)

func (*Client) CloseIdleConnections

func (c *Client) CloseIdleConnections()

func (*Client) Do

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

func (*Client) Get

func (c *Client) Get(path string) (*http.Response, error)

func (*Client) Head

func (c *Client) Head(path string) (*http.Response, error)

func (*Client) Post

func (c *Client) Post(path string, contentType string, body io.Reader) (*http.Response, error)

func (*Client) PostForm

func (c *Client) PostForm(path string, data url.Values) (*http.Response, error)

type Options

type Options struct {
	Context   context.Context
	Client    *http.Client
	Hosts     *list.List
	CheckPath string //健康检查的请求路径
}

Jump to

Keyboard shortcuts

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