resty

package
v1.15.5 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: MIT Imports: 8 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)

NewClient returns a new resty Client.

func NewClientWithConfigPath

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

NewClientWithConfigPath returns a new resty Client with options from config path.

func NewClientWithOptions

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

NewClientWithOptions returns a new resty Client with options.

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
}

Options represents resty client options.

func NewOptions

func NewOptions() (*Options, error)

NewOptions returns options from config file or environment vars.

func NewOptionsWithPath

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

NewOptionsWithPath unmarshals a given key path into options and returns it.

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
}

OptionsTransport represents resty transport options.

type Plugin

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

Plugin defines a function to process plugin.

Directories

Path Synopsis
examples
plugins
contrib/dubonzi/otelresty.v1
This package implements integration between the go-resty (https://github.com/go-resty/resty) library and OpenTelemetry.
This package implements integration between the go-resty (https://github.com/go-resty/resty) library and OpenTelemetry.

Jump to

Keyboard shortcuts

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