apiutil

package
v6.1.3 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2025 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildURL

func BuildURL(path string, queryParams ...neturl.Values) string

BuildURL is a util function that assists with adding query parameters to the url

func Matches added in v6.1.1

func Matches(header, ct string) bool

Matches reports whether content type is acceptable per the header.

func Negotiate added in v6.1.1

func Negotiate(header string, serverTypes []string) (string, bool)

Negotiate selects the best server type according to the header. Returns the chosen type and true, or "", false when nothing matches.

func ParseAccept added in v6.1.1

func ParseAccept(header string) []mediaRange

ParseAccept returns media ranges sorted by q (desc) then specificity.

func PrimaryAcceptMatches added in v6.1.1

func PrimaryAcceptMatches(header, produced string) bool

PrimaryAcceptMatches only checks if the first accept matches

func Uint64ToString

Uint64ToString is a util function that will convert uints to string

Types

This section is empty.

Jump to

Keyboard shortcuts

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