httpclient

package
v0.0.0-...-cc7cbc4 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2021 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 {
	// contains filtered or unexported fields
}

func NewHTTPClient

func NewHTTPClient(cfg clientcredentials.Config) *Client

func (Client) Do

func (c Client) Do(req *http.Request, result interface{}) (*http.Response, *[]byte, *Error)

func (*Client) GetHTTPClient

func (c *Client) GetHTTPClient() *http.Client

func (Client) NewRequest

func (c Client) NewRequest(method, url string, body interface{}) (*http.Request, *Error)

type Error

type Error struct {
	StatusCode int
	Message    string
	Cause      error
}

func NewError

func NewError(err error, opts ...ErrorOpt) *Error

func (Error) Error

func (e Error) Error() string

Error provides a description of the error including all fields which are initialized to a non-default value

func (Error) Unwrap

func (e Error) Unwrap() error

type ErrorOpt

type ErrorOpt func(*Error)

func WithMessage

func WithMessage(message string) ErrorOpt

func WithStatusCode

func WithStatusCode(statusCode int) ErrorOpt

Jump to

Keyboard shortcuts

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