Documentation ¶
Overview ¶
Package status provides utility functions for google_rpc status objects.
Index ¶
- Variables
- func GetDirectHTTPResponse(status rpc.Status) *v1beta1.DirectHttpResponse
- func HTTPStatusFromCode(code rpc.Code) int
- func IsOK(status rpc.Status) bool
- func New(c rpc.Code) rpc.Status
- func PackErrorDetail(response proto.Message) *types.Any
- func String(status rpc.Status) string
- func WithAborted(message string) rpc.Status
- func WithAlreadyExists(message string) rpc.Status
- func WithCancelled(message string) rpc.Status
- func WithDataLoss(message string) rpc.Status
- func WithDeadlineExceeded(message string) rpc.Status
- func WithError(err error) rpc.Status
- func WithFailedPrecondition(message string) rpc.Status
- func WithInternal(message string) rpc.Status
- func WithInvalidArgument(message string) rpc.Status
- func WithMessage(c rpc.Code, message string) rpc.Status
- func WithNotFound(message string) rpc.Status
- func WithOutOfRange(message string) rpc.Status
- func WithPermissionDenied(message string) rpc.Status
- func WithResourceExhausted(message string) rpc.Status
- func WithUnauthenticated(message string) rpc.Status
- func WithUnavailable(message string) rpc.Status
- func WithUnimplemented(message string) rpc.Status
- func WithUnknown(message string) rpc.Status
Constants ¶
This section is empty.
Variables ¶
OK represents a status with a code of rpc.OK
Functions ¶
func GetDirectHTTPResponse ¶
func GetDirectHTTPResponse(status rpc.Status) *v1beta1.DirectHttpResponse
GetDirectHTTPResponse extracts a client-facing error detail for HTTP or returns nil if it is not present.
func HTTPStatusFromCode ¶
HTTPStatusFromCode translates RPC status code to HTTP status code.
func PackErrorDetail ¶
PackErrorDetail packs an HTTP response error detail
func WithAborted ¶
WithAborted returns an initialized status with the rpc.ABORTED code and the given message.
func WithAlreadyExists ¶
WithAlreadyExists returns an initialized status with the rpc.ALREADY_EXISTS code and the given message.
func WithCancelled ¶
WithCancelled returns an initialized status with the rpc.CANCELLED error code and the error's message.
func WithDataLoss ¶
WithDataLoss returns an initialized status with the rpc.DATA_LOSS code and the given message.
func WithDeadlineExceeded ¶
WithDeadlineExceeded returns an initialized status with the rpc.DEADLINE_EXCEEDED code and the given message.
func WithError ¶
WithError returns an initialized status with the rpc.INTERNAL error code and the error's message.
func WithFailedPrecondition ¶
WithFailedPrecondition returns an initialized status with the rpc.FAILED_PRECONDITION code and the given message.
func WithInternal ¶
WithInternal returns an initialized status with the rpc.INTERNAL error code and the error's message.
func WithInvalidArgument ¶
WithInvalidArgument returns an initialized status with the rpc.INVALID_ARGUMENT code and the given message.
func WithMessage ¶
WithMessage returns an initialized status with the given error code and message
func WithNotFound ¶
WithNotFound returns an initialized status with the rpc.NOT_FOUND code and the given message.
func WithOutOfRange ¶
WithOutOfRange returns an initialized status with the rpc.OUT_OF_RANGE code and the given message.
func WithPermissionDenied ¶
WithPermissionDenied returns an initialized status with the rpc.PERMISSION_DENIED code and the given message.
func WithResourceExhausted ¶
WithResourceExhausted returns an initialized status with the rpc.PERMISSION_DENIED code and the given message.
func WithUnauthenticated ¶
WithUnauthenticated returns an initialized status with the rpc.UNAUTHENTICATED code and the given message.
func WithUnavailable ¶
WithUnavailable returns an initialized status with the rpc.UNAVAILABLE code and the given message.
func WithUnimplemented ¶
WithUnimplemented returns an initialized status with the rpc.UNIMPLEMENTED code and the given message.
func WithUnknown ¶
WithUnknown returns an initialized status with the rpc.UNKNOWN code and the given message.
Types ¶
This section is empty.