version

package
v1.18.2 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: Apache-2.0 Imports: 3 Imported by: 0 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

Index

Constants

View Source
const Key = "http-version"

Variables

This section is empty.

Functions

func Format

func Format(v HTTP) string

func SetIfMissing

func SetIfMissing(m map[string]string, v HTTP) map[string]string

Types

type HTTP

type HTTP int
const (
	Unknown HTTP = iota
	V11
	V2
)

HTTP/1.0 is omitted because net/http cannot send HTTP/1.0 requests.

func ParseToken

func ParseToken(raw string) (HTTP, bool)

func ParseValue

func ParseValue(raw string) (HTTP, bool)

func SplitToken

func SplitToken(fields []string) ([]string, HTTP, error)

SplitToken removes a supported trailing HTTP version. Unsupported version tokens return an error.

type UnsupportedError added in v1.2.4

type UnsupportedError struct {
	Token string
}

UnsupportedError reports an unsupported HTTP version token.

func (*UnsupportedError) Error added in v1.2.4

func (e *UnsupportedError) Error() string

Jump to

Keyboard shortcuts

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