client

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2019 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MAX_IDLE_CONNS          = 100
	MAX_IDLE_CONNS_PER_HOST = 100
	IDLE_CONN_TIMEOUT       = 90
)

Variables

This section is empty.

Functions

func ParseHostURL

func ParseHostURL(host string) (*url.URL, error)

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}
var GatewayClient *Client

func NewHTTPClient

func NewHTTPClient(host string, headers map[string]string) (*Client, error)

func (*Client) Close

func (cli *Client) Close() error

func (*Client) Delete

func (cli *Client) Delete(ctx context.Context, path string, query url.Values, headers map[string][]string) (ServerResponse, error)

func (*Client) Get

func (cli *Client) Get(ctx context.Context, path string, query url.Values, headers map[string][]string) (ServerResponse, error)

func (*Client) Head

func (cli *Client) Head(ctx context.Context, path string, query url.Values, headers map[string][]string) (ServerResponse, error)

func (*Client) PATCH

func (cli *Client) PATCH(ctx context.Context, path string, query url.Values, obj interface{}, headers map[string][]string) (ServerResponse, error)

func (*Client) Post

func (cli *Client) Post(ctx context.Context, path string, query url.Values, obj interface{}, headers map[string][]string) (ServerResponse, error)

func (*Client) PostRaw

func (cli *Client) PostRaw(ctx context.Context, path string, query url.Values, body io.Reader, headers map[string][]string) (ServerResponse, error)

func (*Client) Put

func (cli *Client) Put(ctx context.Context, path string, query url.Values, obj interface{}, headers map[string][]string) (ServerResponse, error)

func (*Client) PutRaw

func (cli *Client) PutRaw(ctx context.Context, path string, query url.Values, body io.Reader, headers map[string][]string) (ServerResponse, error)

type ServerResponse

type ServerResponse struct {
	Body       io.ReadCloser
	Header     http.Header
	StatusCode int
	ReqURL     *url.URL
}

Jump to

Keyboard shortcuts

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