httpclient

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2020 License: MIT Imports: 12 Imported by: 57

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CallParams

type CallParams struct {
	Method            string
	Path              string
	Header            http.Header
	Query             url.Values
	RequestBody       interface{}
	ResponseBody      interface{}
	ResponseErrorBody interface{}
	Timeout           time.Duration
}

type Client

type Client struct {
	Endpoint   string
	HTTPClient *http.Client
	SetRequest func(req *http.Request) error
	Timeout    time.Duration
}

func New

func New(endpoint string) Client

func (Client) Call

func (client Client) Call(ctx context.Context, params CallParams) (*http.Response, error)

type Error

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

func (Error) Body

func (e Error) Body() interface{}

func (Error) BodyByte

func (e Error) BodyByte() []byte

func (Error) Error

func (e Error) Error() string

func (Error) StatusCode

func (e Error) StatusCode() int

func (Error) Unwrap

func (e Error) Unwrap() error

Jump to

Keyboard shortcuts

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