accept

package
v0.20231121.1131003 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2023 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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

Header represents an HTTP Accept header value See https://httpwg.org/specs/rfc9110.html#field.accept

func FromString

func FromString(in string) (Header, error)

func (Header) FirstChoice

func (h Header) FirstChoice() *PreferredType

func (Header) String

func (h Header) String() string

type PreferredType

type PreferredType struct {
	// ContentType is a singular media type (e.g. text/plain), or one partially containing
	// wildcards (e.g. text/*), or entirely wildcards (e.g. */*)
	ContentType string

	// Parameters is a map of media type parameters, e.g. charset=utf-8
	Parameters map[string]string

	// Weight is the integer-normalized quality value representing the relative weight/preference
	Weight qValue
}

func (PreferredType) String

func (t PreferredType) String() string

Jump to

Keyboard shortcuts

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