marshaler

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 = &jsonMarshaler{}

Default is the default request marshaler.

Functions

func Register

func Register(m RequestMarshaler) error

Register registers the request marshaler to the registry.

Types

type RequestMarshaler

type RequestMarshaler interface {
	MediaType() string
	Marshal(v interface{}) ([]byte, error)
}

RequestMarshaler is the interface that marshals the HTTP request body.

func Get

func Get(mediaType string) RequestMarshaler

Get returns the request marshaler for the given media type.

If the marshaler is not found, returns the Default.

Jump to

Keyboard shortcuts

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