codes

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2025 License: BSD-3-Clause Imports: 4 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Canonical

func Canonical(c Code) string

func GRPC

func GRPC(code Code) codes.Code

GRPC returns the gRPC code for the given error code.

func GRPCToHTTP

func GRPCToHTTP(code codes.Code) int

GRPCToHTTP returns the HTTP code for the given grpc code.

func HTTP

func HTTP(code Code) int

̱HTTP returns the HTTP status code for the given error code.

func Text

func Text(c Code) string

Types

type Code

type Code int
const (
	Aborted            Code // aborted
	BadRequest              // bad_request
	Canceled                // canceled
	Conflict                // conflict
	DataLoss                // data_loss
	DeadlineExceeded        // deadline_exceeded
	Exists                  // exists
	Forbidden               // forbidden
	Internal                // internal
	NotFound                // not_found
	NotImplemented          // not_implemented
	OutOfRange              // out_of_range
	PreconditionFailed      // precondition_failed
	TooManyRequests         // too_many_requests
	Unauthorized            // unauthorized
	Unavailable             // unavailable
	Unknown                 // unknown
)

func (Code) String

func (i Code) String() string

func (Code) Valid

func (c Code) Valid() bool

Jump to

Keyboard shortcuts

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