status

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2019 License: Apache-2.0 Imports: 5 Imported by: 3

Documentation

Overview

Package status contains helpers functions to create grpc Status with contextual information, like traces.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewErrorFromCode

func NewErrorFromCode(code rpcpb.Code, pkgname string) error

NewErrorFromCode returns a standardized Error for a given RPC code.

func NewInternal

func NewInternal(ctx context.Context, err error, msg string) *rpcpb.Status

NewInternal returns a Status with CODE_INTERNAL and logs the msg. In this case, err MUST be filled for tracking purposes.

func NewInvalid

func NewInvalid(ctx context.Context, msg string) *rpcpb.Status

NewInvalid returns a Status with CODE_INVALID_ARGUMENT and logs the msg.

func NewInvalidArg

func NewInvalidArg(ctx context.Context, msg string) *rpcpb.Status

NewInvalidArg returns a Status with CODE_INVALID_ARGUMENT.

func NewNotFound

func NewNotFound(ctx context.Context, msg string) *rpcpb.Status

NewNotFound returns a Status with CODE_NOT_FOUND and logs the msg.

func NewOK

func NewOK(ctx context.Context) *rpcpb.Status

NewOK returns a Status with CODE_OK.

func NewUnauthenticated

func NewUnauthenticated(ctx context.Context, err error, msg string) *rpcpb.Status

NewUnauthenticated returns a Status with CODE_UNAUTHENTICATED and logs the msg.

func NewUnimplemented

func NewUnimplemented(ctx context.Context, err error, msg string) *rpcpb.Status

NewUnimplemented returns a Status with CODE_UNIMPLEMENTED and logs the msg.

Types

This section is empty.

Jump to

Keyboard shortcuts

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