goautoneg

package
v0.0.0-...-d88c8b5 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Negotiate

func Negotiate(header string, alternatives []string) (content_type string)

Negotiate the most appropriate content_type given the accept header and a list of alternatives.

func ParseAccept

func ParseAccept(header string) acceptSlice

Parse an Accept Header string returning a sorted list of clauses

Types

type Accept

type Accept struct {
	Type, SubType string
	Q             float64
	Params        map[string]string
}

Structure to represent a clause in an HTTP Accept Header

Jump to

Keyboard shortcuts

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