httpcore

package
v1.0.10 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TraceIDHeader = "uber-trace-id"

	DeviceHeader             = "x-vkusvill-device"
	DeviceDefaultHeaderValue = "catalog4"

	TokenHeader = "x-vkusvill-token"
)

Variables

View Source
var (
	ErrBadStatusCode = errors.New("bad status code")
)

Functions

func GetHandleErrorFunc

func GetHandleErrorFunc[T any](api, method string, defaultValue T) func(err error, response response) (T, error)

func GetHandleErrorFuncNoRet

func GetHandleErrorFuncNoRet(api, method string) func(err error, response response) error

func HandleHTTPError

func HandleHTTPError(err error, response response) error

Types

type HTTPError

type HTTPError struct {
	API        string
	Method     string
	StatusCode int
	Message    string
	// contains filtered or unexported fields
}

func NewHTTPError

func NewHTTPError(err error, api, method string, statusCode int, message string) *HTTPError

func (*HTTPError) Error

func (e *HTTPError) Error() string

Jump to

Keyboard shortcuts

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