version

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

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