status

package
v0.0.0-...-865e90e Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2018 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package status provides utility functions for google_rpc status objects.

Index

Constants

This section is empty.

Variables

View Source
var OK = rpc.Status{Code: int32(rpc.OK)}

OK represents a status with a code of rpc.OK

Functions

func IsOK

func IsOK(status rpc.Status) bool

IsOK returns true is the given status has the code rpc.OK

func New

func New(c rpc.Code) rpc.Status

New returns an initialized status with the given error code.

func String

func String(status rpc.Status) string

String produces a string representation of rpc.Status.

func WithCancelled

func WithCancelled(message string) rpc.Status

WithCancelled returns an initialized status with the rpc.CANCELLED error code and the error's message.

func WithDeadlineExceeded

func WithDeadlineExceeded(message string) rpc.Status

WithDeadlineExceeded returns an initialized status with the rpc.DEADLINE_EXCEEDED code and the given message.

func WithError

func WithError(err error) rpc.Status

WithError returns an initialized status with the rpc.INTERNAL error code and the error's message.

func WithInternal

func WithInternal(message string) rpc.Status

WithInternal returns an initialized status with the rpc.INTERNAL error code and the error's message.

func WithInvalidArgument

func WithInvalidArgument(message string) rpc.Status

WithInvalidArgument returns an initialized status with the rpc.INVALID_ARGUMENT code and the given message.

func WithMessage

func WithMessage(c rpc.Code, message string) rpc.Status

WithMessage returns an initialized status with the given error code and message

func WithPermissionDenied

func WithPermissionDenied(message string) rpc.Status

WithPermissionDenied returns an initialized status with the rpc.PERMISSION_DENIED code and the given message.

func WithResourceExhausted

func WithResourceExhausted(message string) rpc.Status

WithResourceExhausted returns an initialized status with the rpc.PERMISSION_DENIED code and the given message.

Types

This section is empty.

Jump to

Keyboard shortcuts

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