request

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GET  = "GET"
	POST = "POST"
	PUT  = "PUT"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type HttpClient

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

func NewDefaultHttpClient

func NewDefaultHttpClient(baseURL string) *HttpClient

func NewInsecureHttpClient

func NewInsecureHttpClient(baseURL string) *HttpClient

func NewSecureHttpClient

func NewSecureHttpClient(baseURL string, certificate []byte) *HttpClient

func (*HttpClient) Do

func (c *HttpClient) Do(method, endpoint string, body io.Reader, modifiers ...RequestModifier) (*http.Response, error)

type RequestError

type RequestError struct {
	Message    string
	StatusCode uint
}

func (RequestError) Error

func (e RequestError) Error() string

type RequestModifier

type RequestModifier func(*http.Request)

func WithApiKey

func WithApiKey(key string) RequestModifier

type Requester

type Requester interface {
	Do(method, endpoint string, body io.Reader, modifiers ...RequestModifier) (*http.Response, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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