negotiator

package
v0.0.0-...-fe528e9 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

README

管理解析器

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Registry

func Registry(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 (
	MIME_POST_FORM  MIME = "application/x-www-form-urlencoded"
	MIME_TEXT_PLAIN MIME = "text/plain"
	MIME_TEXT_HTML       = "text/html"
)
const (
	MIME_JSON MIME = "application/json"
)
const (
	MIME_YAML MIME = "application/yaml"
)
const (
	MIME_YAML_K8S MIME = "application/yaml-k8s"
)

type Negotiator

type Negotiator interface {
	ContentType() MIME
	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