httpclient

package
v0.0.0-...-faa9808 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2023 License: MIT Imports: 6 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 {
	Ctx      context.Context
	Endpoint string
	Timeout  time.Duration
	Method   string
}

func (*HTTPClient) MakeRequest

func (c *HTTPClient) MakeRequest(obj interface{}) error

func (*HTTPClient) NewClient

func (c *HTTPClient) NewClient(opts ...Option) *HTTPClient

NewClient - with default value and/or options

type IHttpClient

type IHttpClient interface {
	NewClient(opts ...Option) *HTTPClient
	MakeRequest(obj interface{}) error
}

type Option

type Option func(*HTTPClient)

func Ctx

func Ctx(ctx context.Context) Option

func Endpoint

func Endpoint(endpoint string) Option

func Method

func Method(method string) Option

func Timeout

func Timeout(timeout time.Duration) Option

Jump to

Keyboard shortcuts

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