internal

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Accept

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

Accept is a type designed to help working with header values found in the "Accept" header.

func ParseAccept

func ParseAccept(request *http.Request) Accept

ParseAccept creates a new Accept based on a http.Request by parsing its headers.

func (Accept) Accepts

func (accept Accept) Accepts(media string) bool

Accepts reports whether the given media is found in the accept headers.

func (Accept) Order

func (accept Accept) Order() []string

Order creates an ordered slice that contains the actual acceptance order based on the accept quality.

func (Accept) Quality

func (accept Accept) Quality(media string) float64

Quality returns the quality of the given media found in the accept headers.

Returns 0 if not found.

Jump to

Keyboard shortcuts

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