negotiator

package
v1.9.1 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2022 License: MIT Imports: 2 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Registry

func Registry(df MIME, n Negotiator)

Types

type Decoder

type Decoder interface {
	Decode(data []byte, v any) error
}

type Encoder

type Encoder interface {
	Encode(v any) ([]byte, error)
}

type MIME

type MIME string
const (
	MIMEJSON MIME = "application/json"
	MIMEXML  MIME = "application/xml"
	MIMEYAML MIME = "application/yaml"
)

type Negotiator

type Negotiator interface {
	Name() string
	Decoder
	Encoder
}

func GetNegotiator

func GetNegotiator(m string) Negotiator

Jump to

Keyboard shortcuts

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