http

package
v0.1.0-alpha3 Latest Latest
Warning

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

Go to latest
Published: May 18, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// HeaderAccept is accept header.
	HeaderAccept = http.CanonicalHeaderKey("Accept")
	// HeaderContentType is content-type header.
	HeaderContentType = http.CanonicalHeaderKey("Content-Type")
	// HeaderAcceptLanguage is accept-language header.
	HeaderAcceptLanguage = http.CanonicalHeaderKey("Accept-Language")
)

Functions

func ContentSubtype

func ContentSubtype(contentType string) string

ContentSubtype returns the content-subtype for the given content-type. The given content-type must be a valid content-type that starts with but no content-subtype will be returned. according rfc7231. contentType is assumed to be lowercase already.

func ContentType

func ContentType(subtype string) string

ContentType returns the content-type with base prefix.

func GRPCCodeFromStatus

func GRPCCodeFromStatus(code int) codes.Code

GRPCCodeFromStatus converts a HTTP error code into the corresponding gRPC response status. See: https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto

func StatusFromGRPCCode

func StatusFromGRPCCode(code codes.Code) int

StatusFromGRPCCode converts a gRPC error code into the corresponding HTTP response status. See: https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto

Types

This section is empty.

Jump to

Keyboard shortcuts

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