negotiation

package
v2.40.0 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2026 License: MIT Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package negotiation provides utilities for working with HTTP client- driven content negotiation. It provides a zero-allocation utility for determining the best content type for the server to encode a response.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SelectQValue

func SelectQValue(header string, allowed []string) string

SelectQValue selects and returns the best value from the allowed set given a header with optional quality values, as you would get for an Accept or Accept-Encoding header. The *first* item in allowed is preferred if there is a tie. If nothing matches, returns an empty string.

func SelectQValueFast

func SelectQValueFast(header string, allowed []string) string

SelectQValueFast is a faster version of SelectQValue that does not need any dynamic memory allocations.

Types

This section is empty.

Jump to

Keyboard shortcuts

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