unmarshaler

package
v0.13.3-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Default = &binaryUnmarshaler{}

Default is the default response unmarshaler.

Functions

func Register

func Register(um ResponseUnmarshaler) error

Register registers the response unmarshaler to the registry.

Types

type ResponseUnmarshaler

type ResponseUnmarshaler interface {
	MediaType() string
	Unmarshal(data []byte, v interface{}) error
}

ResponseUnmarshaler is the interface that unmarshals the HTTP response body.

func Get

func Get(mediaType string) ResponseUnmarshaler

Get returns the response unmarshaler for the given media type.

If the unmarshaler is not found, returns the Default.

Jump to

Keyboard shortcuts

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