httputil

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// StatusClientClosed is non-standard http status code,
	// which defined by nginx.
	// https://httpstatus.in/499/
	StatusClientClosed = 499
)

Variables

This section is empty.

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