Source File
codes.go
Belonging Package
google.golang.org/grpc/codes
package codes // import "google.golang.org/grpc/codes"
import (
)
InvalidArgument Code = 3
DeadlineExceeded Code = 4
AlreadyExists Code = 6
PermissionDenied Code = 7
OutOfRange Code = 11
Unimplemented Code = 12
Unavailable Code = 14
Unauthenticated Code = 16
_maxCode = 17
)
var strToCode = map[string]Code{
`"OK"`: OK,
`"CANCELLED"`:/* [sic] */ Canceled,
`"UNKNOWN"`: Unknown,
`"INVALID_ARGUMENT"`: InvalidArgument,
`"DEADLINE_EXCEEDED"`: DeadlineExceeded,
`"NOT_FOUND"`: NotFound,
`"ALREADY_EXISTS"`: AlreadyExists,
`"PERMISSION_DENIED"`: PermissionDenied,
`"RESOURCE_EXHAUSTED"`: ResourceExhausted,
`"FAILED_PRECONDITION"`: FailedPrecondition,
`"ABORTED"`: Aborted,
`"OUT_OF_RANGE"`: OutOfRange,
`"UNIMPLEMENTED"`: Unimplemented,
`"INTERNAL"`: Internal,
`"UNAVAILABLE"`: Unavailable,
`"DATA_LOSS"`: DataLoss,
`"UNAUTHENTICATED"`: Unauthenticated,
}
if string() == "null" {
return nil
}
if == nil {
return fmt.Errorf("nil receiver passed to UnmarshalJSON")
}
if , := strconv.ParseUint(string(), 10, 32); == nil {
if >= _maxCode {
return fmt.Errorf("invalid code: %q", )
}
* = Code()
return nil
}
if , := strToCode[string()]; {
* =
return nil
}
return fmt.Errorf("invalid code: %q", string())
![]() |
The pages are generated with Golds v0.3.2-preview. (GOOS=darwin GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |