helper

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2024 License: BSD-2-Clause Imports: 17 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 HttpErrorCode added in v0.17.0

func HttpErrorCode(err merry.Error) (code int)

func MergeHttpErrorMap added in v0.15.3

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

func MergeHttpErrors added in v0.15.3

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

func MerryRootError added in v0.17.0

func MerryRootError(err error) string

MerryRootError strip merry error chain

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) (resp *ServerResponse, err 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) (resp []*ServerResponse, err 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