helper

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2022 License: BSD-2-Clause Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetHTTPClient added in v0.16.0

func GetHTTPClient(logger *zap.Logger, config types.BackendV2) *http.Client

func HttpErrorByCode added in v0.15.3

func HttpErrorByCode(err merry.Error) merry.Error

func MergeHttpErrorMap added in v0.15.3

func MergeHttpErrorMap(errorsMap map[string]merry.Error) (int, []string)

func MergeHttpErrors added in v0.15.3

func MergeHttpErrors(errors []merry.Error) (int, []string)

Types

type HttpQuery

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

func NewHttpQuery

func NewHttpQuery(groupName string, servers []string, maxTries int, limiter limiter.ServerLimiter, client *http.Client, encoding string) *HttpQuery

func (*HttpQuery) DoQuery

func (c *HttpQuery) DoQuery(ctx context.Context, logger *zap.Logger, uri string, r types.Request) (*ServerResponse, merry.Error)

func (*HttpQuery) DoQueryToAll added in v0.15.0

func (c *HttpQuery) DoQueryToAll(ctx context.Context, logger *zap.Logger, uri string, r types.Request) ([]*ServerResponse, merry.Error)

type ServerResponse

type ServerResponse struct {
	Server   string
	Response []byte
}

Jump to

Keyboard shortcuts

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