protocol

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2026 License: MIT Imports: 0 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

Overview

Package protocol holds the protocol and format names shared by the production code and the tests: HTTP header names, media types, the names of the supported configuration formats and network names.

The package only declares constants. Use the net/http constants for the HTTP methods and status codes instead of redeclaring them here.

Index

Constants

View Source
const (
	// FormatCSV is the name of the CSV format.
	FormatCSV = "csv"
	// FormatJSON is the name of the JSON format.
	FormatJSON = "json"
	// FormatTOML is the name of the TOML format.
	FormatTOML = "toml"
	// FormatYAML is the name of the YAML format.
	FormatYAML = "yaml"
)

Names of the configuration and export formats.

View Source
const (
	// HeaderAuthorization is the name of the header carrying the credentials of a request.
	HeaderAuthorization = "Authorization"
	// HeaderContentType is the name of the header carrying the media type of a body.
	HeaderContentType = "Content-Type"
	// HeaderETag is the name of the header carrying the entity tag of a response.
	HeaderETag = "ETag"
	// HeaderIfNoneMatch is the name of the header carrying the entity tag a client already holds.
	HeaderIfNoneMatch = "If-None-Match"
	// HeaderOrigin is the name of the header carrying the origin of a cross-origin request.
	HeaderOrigin = "Origin"
)

HTTP header names.

View Source
const (
	// BearerPrefix is the scheme prefix of an Authorization header carrying a bearer token.
	BearerPrefix = "Bearer "
	// MIMEApplicationJSON is the media type of a JSON body.
	MIMEApplicationJSON = "application/json"
)
View Source
const NetworkTCP = "tcp"

NetworkTCP is the name of the TCP network, as accepted by net.Listen and net.Dial.

Variables

This section is empty.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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