negotiation

package
v2.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2023 License: MIT Imports: 2 Imported by: 2

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