resty

package
v1.0.0-beta.19 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PluginsRoot = root + ".plugins"
)

Variables

This section is empty.

Functions

func ConfigAdd

func ConfigAdd(path string)

func NewClient

func NewClient(ctx context.Context, plugins ...Plugin) (*resty.Client, error)

func NewClientWithConfigPath

func NewClientWithConfigPath(ctx context.Context, path string, plugins ...Plugin) (*resty.Client, error)

func NewClientWithOptions

func NewClientWithOptions(ctx context.Context, options *Options, plugins ...Plugin) *resty.Client

Types

type Options

type Options struct {
	Debug             bool
	ConnectionTimeout time.Duration
	CloseConnection   bool
	KeepAlive         time.Duration
	RequestTimeout    time.Duration
	FallbackDelay     time.Duration
	Transport         OptionsTransport
	Host              string
}

func NewOptions

func NewOptions() (*Options, error)

func NewOptionsWithPath

func NewOptionsWithPath(path string) (opts *Options, err error)

type OptionsTransport

type OptionsTransport struct {
	DisableCompression    bool
	DisableKeepAlives     bool
	MaxIdleConnsPerHost   int
	ResponseHeaderTimeout time.Duration
	ForceAttemptHTTP2     bool `config:"forceAttemptHTTP2"`
	MaxIdleConns          int
	MaxConnsPerHost       int
	IdleConnTimeout       time.Duration
	TLSHandshakeTimeout   time.Duration
	ExpectContinueTimeout time.Duration
}

type Plugin

type Plugin func(context.Context, *resty.Client) error

Jump to

Keyboard shortcuts

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