Documentation ¶
Overview ¶
Package rpcstatus contains status code definitions for rpc.
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.
func Wrap ¶
func Wrap(code StatusCode, err error) error
Wrap wraps the error with the provided status code.
Types ¶
type StatusCode ¶
type StatusCode uint64
StatusCode is an enumeration of rpc status codes.
const ( Unknown StatusCode = 0 OK StatusCode = 1 Canceled StatusCode = 2 InvalidArgument StatusCode = 3 DeadlineExceeded StatusCode = 4 NotFound StatusCode = 5 AlreadyExists StatusCode = 6 PermissionDenied StatusCode = 7 ResourceExhausted StatusCode = 8 FailedPrecondition StatusCode = 9 Aborted StatusCode = 10 OutOfRange StatusCode = 11 Unimplemented StatusCode = 12 Internal StatusCode = 13 DataLoss StatusCode = 15 Unauthenticated StatusCode = 16 MethodNotAllowed StatusCode = 17 ObjectLockEndpointsDisabled StatusCode = 10000 ObjectLockDisabledForProject StatusCode = 10001 ObjectLockInvalidBucketState StatusCode = 10002 ObjectLockBucketRetentionConfigurationMissing StatusCode = 10003 ObjectLockObjectRetentionConfigurationMissing StatusCode = 10004 ObjectLockObjectProtected StatusCode = 10005 ObjectLockInvalidObjectState StatusCode = 10006 ObjectLockInvalidBucketRetentionConfiguration StatusCode = 10007 )
These constants are all the rpc error codes. It is important that their numerical values do not change.
func (StatusCode) String ¶
func (i StatusCode) String() string
Click to show internal directories.
Click to hide internal directories.