httpclient

package
v0.0.0-...-3a6b306 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2019 License: MIT Imports: 10 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*http.Client
}

func NewClient

func NewClient(c *http.Client) *Client

func NewUrlfetchClient

func NewUrlfetchClient(ctx context.Context, seconds ...int) *Client

func (*Client) Delete

func (client *Client) Delete(url string, src interface{}, headers ...map[string]string) ([]byte, error)

func (*Client) Get

func (client *Client) Get(url string, dst interface{}, headers ...map[string]string) ([]byte, error)

func (*Client) New

func (client *Client) New(httpRequest *http.Request) *Request

func (*Client) Post

func (client *Client) Post(url string, src, dst interface{}, headers ...map[string]string) ([]byte, error)

type Request

type Request struct {
	*Client
	*http.Request
	Retries int
	Success string
}

func (*Request) DoReq

func (req *Request) DoReq() ([]byte, error)

func (*Request) WithRetry

func (req *Request) WithRetry(retry int) *Request

func (*Request) WithStatus

func (req *Request) WithStatus(successStatusCodes string) *Request

Jump to

Keyboard shortcuts

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