interpreter

package
v0.0.0-...-562dbd9 Latest Latest
Warning

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

Go to latest
Published: May 29, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnmarshal          = errors.New("unmarshal failed")
	ErrMissingContentType = errors.New("mime.ParseMediaType failed")
)

Functions

func DefaultStatusCodeMappingToErr

func DefaultStatusCodeMappingToErr(res *http.Response, body []byte) error

Types

type ErrorHandler

type ErrorHandler struct {
	JSON FaultyResponseHandler
}

ErrorHandler invokes a function that matches response media type with parse error, ex: JSON<->JsonParserMethod otherwise defaults to general error interpretation.

func (ErrorHandler) Handle

func (h ErrorHandler) Handle(res *http.Response, body []byte) error

type FaultyResponseHandler

type FaultyResponseHandler func(res *http.Response, body []byte) error

FaultyResponseHandler used to parse erroneous response.

Jump to

Keyboard shortcuts

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