apiutil

package
v7.0.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 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

func Matches(header, ct string) bool

Matches reports whether content type is acceptable per the header.

func Negotiate

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

func ParseAccept(header string) []mediaRange

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

func PrimaryAcceptMatches

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