unmarshaler

package
v0.13.1-rc1 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2022 License: Apache-2.0 Imports: 8 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