Documentation ¶
Overview ¶
Package status extends google.golang.org/grpc/status
Index ¶
- Variables
- func ErrorDetailString(err error) string
- func IsAborted(err error) bool
- func IsAlreadyExists(err error) bool
- func IsCanceled(err error) bool
- func IsDataLoss(err error) bool
- func IsDeadlineExceeded(err error) bool
- func IsFailedPrecondition(err error) bool
- func IsInternal(err error) bool
- func IsInvalidArgument(err error) bool
- func IsNotFound(err error) bool
- func IsOK(err error) bool
- func IsOutOfRange(err error) bool
- func IsPermissionDenied(err error) bool
- func IsResourceExhausted(err error) bool
- func IsUnauthenticated(err error) bool
- func IsUnavailable(err error) bool
- func IsUnimplemented(err error) bool
- func IsUnknown(err error) bool
- type BadRequest
- type DebugInfo
- type ErrorInfo
- type Help
- type LocalizedMessage
- type PreconditionFailure
- type QuotaFailure
- type RequestInfo
- type ResourceInfo
- type RetryInfo
- type Status
- func Aborted(format string, a ...any) *Status
- func AlreadyExists(format string, a ...any) *Status
- func Canceled(format string, a ...any) *Status
- func DataLoss(format string, a ...any) *Status
- func DeadlineExceeded(format string, a ...any) *Status
- func FailedPrecondition(format string, a ...any) *Status
- func Internal(format string, a ...any) *Status
- func InvalidArgument(format string, a ...any) *Status
- func NotFound(format string, a ...any) *Status
- func OK() *Status
- func OutOfRange(format string, a ...any) *Status
- func PermissionDenied(format string, a ...any) *Status
- func ResourceExhausted(format string, a ...any) *Status
- func Unauthenticated(format string, a ...any) *Status
- func Unavailable(format string, a ...any) *Status
- func Unimplemented(format string, a ...any) *Status
- func Unknown(format string, a ...any) *Status
Constants ¶
This section is empty.
Variables ¶
var ( // New returns a Status representing c and msg. New = status.New // Newf returns New(c, fmt.Sprintf(format, a...)). Newf = status.Newf // Error returns an error representing c and msg. If c is OK, returns nil. Error = status.Error // Errorf returns Error(c, fmt.Sprintf(format, a...)). Errorf = status.Errorf // ErrorProto returns an error representing s. If s.Code is OK, returns nil. ErrorProto = status.ErrorProto // FromProto returns a Status representing s. FromProto = status.FromProto // FromError returns a Status representing err if it was produced from this // package or has a method `GRPCStatus() *Status`. Otherwise, ok is false and a // Status is returned with codes.Unknown and the original error message. FromError = status.FromError // Convert is a convenience function which removes the need to handle the // boolean return value from FromError. Convert = status.Convert // Code returns the Code of the error if it is a Status error, codes.OK if err // is nil, or codes.Unknown otherwise. Code = status.Code // FromContextError converts a context error into a Status. It returns a // Status with codes.OK if err is nil, or a Status with codes.Unknown if err is // non-nil and not a context error. FromContextError = status.FromContextError )
Functions ¶
func ErrorDetailString ¶
ErrorDetailString returns err.Error() with details message if err is Status
func IsAborted ¶ added in v0.4.4
IsAborted return true if Status.Code equals codes.Aborted, else false
func IsAlreadyExists ¶ added in v0.4.4
IsAlreadyExists return true if Status.Code equals codes.AlreadyExists, else false
func IsCanceled ¶ added in v0.4.4
IsCanceled return true if Status.Code equals codes.Canceled, else false
func IsDataLoss ¶ added in v0.4.4
IsDataLoss return true if Status.Code equals codes.DataLoss, else false
func IsDeadlineExceeded ¶ added in v0.4.4
IsDeadlineExceeded return true if Status.Code equals codes.DeadlineExceeded, else false
func IsFailedPrecondition ¶ added in v0.4.4
IsFailedPrecondition return true if Status.Code equals codes.FailedPrecondition, else false
func IsInternal ¶ added in v0.4.4
IsInternal return true if Status.Code equals codes.Internal, else false
func IsInvalidArgument ¶ added in v0.4.4
IsInvalidArgument return true if Status.Code equals codes.InvalidArgument, else false
func IsNotFound ¶
IsNotFound return true if Status.Code equals codes.NotFound, else false
func IsOutOfRange ¶ added in v0.4.4
IsOutOfRange return true if Status.Code equals codes.OutOfRange, else false
func IsPermissionDenied ¶ added in v0.4.4
IsPermissionDenied return true if Status.Code equals codes.PermissionDenied, else false
func IsResourceExhausted ¶ added in v0.4.4
IsResourceExhausted return true if Status.Code equals codes.ResourceExhausted, else false
func IsUnauthenticated ¶ added in v0.4.4
IsUnauthenticated return true if Status.Code equals codes.Unauthenticated, else false
func IsUnavailable ¶ added in v0.4.4
IsUnavailable return true if Status.Code equals codes.Unavailable, else false
func IsUnimplemented ¶ added in v0.4.4
IsUnimplemented return true if Status.Code equals codes.Unimplemented, else false
Types ¶
type BadRequest ¶
type BadRequest = errdetails.BadRequest
BadRequest describes violations in a client request.
type DebugInfo ¶
type DebugInfo = errdetails.DebugInfo
DebugInfo describes additional debugging info.
type ErrorInfo ¶
type ErrorInfo = errdetails.ErrorInfo
ErrorInfo describes the cause of the error with structured details.
type Help ¶
type Help = errdetails.Help
Help provides links to documentation or for performing an out of band action.
type LocalizedMessage ¶
type LocalizedMessage = errdetails.LocalizedMessage
LocalizedMessage provides a localized error message that is safe to return to the user which can be attached to an RPC error.
type PreconditionFailure ¶
type PreconditionFailure = errdetails.PreconditionFailure
PreconditionFailure describes what preconditions have failed.
type QuotaFailure ¶
type QuotaFailure = errdetails.QuotaFailure
QuotaFailure describes how a quota check failed.
type RequestInfo ¶
type RequestInfo = errdetails.RequestInfo
RequestInfo contains metadata about the request that clients can attach when filing a bug or providing other forms of feedback.
type ResourceInfo ¶
type ResourceInfo = errdetails.ResourceInfo
ResourceInfo describes the resource that is being accessed.
type RetryInfo ¶
type RetryInfo = errdetails.RetryInfo
RetryInfo describes when the clients can retry a failed request.
type Status ¶
Status references google.golang.org/grpc/internal/status. It represents an RPC status code, message, and details. It is immutable and should be created with New, Newf, or FromProto. https://godoc.org/google.golang.org/grpc/internal/status
func AlreadyExists ¶
AlreadyExists returns a Status AlreadyExists
func DeadlineExceeded ¶ added in v0.4.4
DeadlineExceeded returns a Status DeadlineExceeded
func FailedPrecondition ¶
FailedPrecondition returns a Status FailedPrecondition
func InvalidArgument ¶
InvalidArgument returns a Status InvalidArgument
func OutOfRange ¶
OutOfRange returns a Status OutOfRange
func PermissionDenied ¶ added in v0.1.1
PermissionDenied returns a Status PermissionDenied
func ResourceExhausted ¶
ResourceExhausted returns a Status ResourceExhausted
func Unauthenticated ¶ added in v0.1.1
Unauthenticated returns a Status Unauthenticated
func Unavailable ¶ added in v0.4.4
Unavailable returns a Status Unavailable
func Unimplemented ¶
Unimplemented returns a Status Unimplemented