client

package
v0.0.0-...-5fde495 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Seconds30             = 30 * time.Second
	MaxIdleConns          = 100
	IdleConnTimeout       = 90 * time.Second
	TLSHandshakeTimeout   = 10 * time.Second
	ExpectContinueTimeout = 1 * time.Second
)
View Source
const (
	Attempts = 10
	Delay    = time.Millisecond * 100
	Error400 = 400
	Error500 = 500
)

Variables

View Source
var (
	ErrStatus = errors.New("server replied with status: ")
)

Functions

This section is empty.

Types

type Client

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

func New

func New(username, token string, options ...Option) *Client

func (*Client) Delete

func (c *Client) Delete(ctx context.Context, path string) error

func (*Client) Get

func (c *Client) Get(ctx context.Context, path string, target interface{}) error

func (*Client) Patch

func (c *Client) Patch(ctx context.Context, path string, target interface{}, body interface{}) error

func (*Client) Post

func (c *Client) Post(ctx context.Context, path string, target interface{}, body interface{}) error

type Option

type Option func(c *Client)

func OptionWithBaseURL

func OptionWithBaseURL(baseURL string) Option

Jump to

Keyboard shortcuts

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