httpclient

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HttpClient

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

func New

func New(baseURL, apiKey, apiSecret string, timeout time.Duration) *HttpClient

func (*HttpClient) Delete

func (h *HttpClient) Delete(requestData RequestData, responseData ResponseData) error

func (*HttpClient) Get

func (h *HttpClient) Get(requestData RequestData, responseData ResponseData) error

func (*HttpClient) Post

func (h *HttpClient) Post(requestData RequestData, responseData ResponseData) error

func (*HttpClient) Upload

func (h *HttpClient) Upload(requestData RequestData, responseData ResponseData, filename string) error

type RequestData

type RequestData interface {
	Path() (string, error)
	Encode() (string, error)
}

type ResponseData

type ResponseData interface {
	Decode(body io.ReadCloser) error
	SetBody(body io.ReadCloser)
	SetStatusCode(code int)
}

Jump to

Keyboard shortcuts

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