Documentation ¶
Overview ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AcceptLanguage ¶
A single language from the Accept-Language HTTP header.
type AcceptLanguages ¶
type AcceptLanguages []AcceptLanguage
A slice of sortable AcceptLanguage instances.
func Read ¶
func Read(lang string) AcceptLanguages
The parsed structure is a slice of Accept-Language values stored in an AcceptLanguages instance, sorted based on the language qualifier.
func ReadHeader ¶
func ReadHeader(header http.Header) AcceptLanguages
func (AcceptLanguages) Best ¶
func (al AcceptLanguages) Best() AcceptLanguage
Returns the language with the highest quality score
func (AcceptLanguages) Len ¶
func (al AcceptLanguages) Len() int
Returns the total number of items in the slice. Implemented to satisfy sort.Interface.
func (AcceptLanguages) Less ¶
func (al AcceptLanguages) Less(i, j int) bool
Determines whether or not the item at position i is "less than" the item at position j. Implemented to satisfy sort.Interface.
func (AcceptLanguages) String ¶
func (al AcceptLanguages) String() string
Returns the parsed languages in a human readable fashion.
func (AcceptLanguages) Swap ¶
func (al AcceptLanguages) Swap(i, j int)
Swaps the items at position i and j. Implemented to satisfy sort.Interface.