rpcstatus

package
v0.25.3 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2019 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Error

func Error(code StatusCode, msg string) error

Error wraps the message with a status code into an error.

func Errorf

func Errorf(code StatusCode, format string, a ...interface{}) error

Errorf : Error :: fmt.Sprintf : fmt.Sprint

Types

type StatusCode

type StatusCode uint64

StatusCode is an enumeration of rpc status codes.

const (
	Unknown StatusCode = iota
	OK
	Canceled
	InvalidArgument
	DeadlineExceeded
	NotFound
	AlreadyExists
	PermissionDenied
	ResourceExhausted
	FailedPrecondition
	Aborted
	OutOfRange
	Unimplemented
	Internal
	Unavailable
	DataLoss
	Unauthenticated
)

These constants are all the rpc error codes. It is important that their numerical values do not change.

func Code

func Code(err error) StatusCode

Code returns the status code associated with the error.

Jump to

Keyboard shortcuts

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