httpClient

package
v0.12.19 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 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 Config

type Config struct {
	HttpTimeout time.Duration
}

type Handler

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

func New

func New(ctx context.Context, config Config) *Handler

func (*Handler) Get

func (h *Handler) Get(url string, options ...Option) (Response, error)

func (*Handler) Post

func (h *Handler) Post(url string, data []byte, options ...Option) (Response, error)

func (*Handler) Put

func (h *Handler) Put(url string, data []byte, options ...Option) (Response, error)

func (*Handler) PutStream

func (h *Handler) PutStream(url string, body io.Reader, options ...Option) (Response, error)

type Option

type Option func(cfg *optionConfig)

func BearerAuthorization

func BearerAuthorization(token string) Option

func ContentType

func ContentType(contentType string) Option

type Response

type Response struct {
	StatusCode int
	Body       []byte
}

Jump to

Keyboard shortcuts

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