negotiate

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2026 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultFormats

func DefaultFormats() map[string]core.Format

func DefaultJSONFormat

func DefaultJSONFormat() core.Format

func SelectQValue

func SelectQValue(header string, allowed []string) string

func SelectQValueFast

func SelectQValueFast(header string, allowed []string) string

Types

type Negotiator

type Negotiator struct {
	// contains filtered or unexported fields
}

func NewNegotiator

func NewNegotiator(formats map[string]core.Format, defaultFormat string, noFallback bool) *Negotiator

func (*Negotiator) Marshal

func (n *Negotiator) Marshal(w io.Writer, ct string, v any) error

func (*Negotiator) Negotiate

func (n *Negotiator) Negotiate(accept string) (string, error)

func (*Negotiator) Unmarshal

func (n *Negotiator) Unmarshal(ct string, data []byte, v any) error

Jump to

Keyboard shortcuts

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