istio: istio.io/istio/mixer/pkg/status Index | Files

package status

import "istio.io/istio/mixer/pkg/status"

Package status provides utility functions for google_rpc status objects.

Index

Package Files

status.go

Variables

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

OK represents a status with a code of rpc.OK

func GetDirectHTTPResponse Uses

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 Uses

func HTTPStatusFromCode(code rpc.Code) int

HTTPStatusFromCode translates RPC status code to HTTP status code.

func IsOK Uses

func IsOK(status rpc.Status) bool

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

func New Uses

func New(c rpc.Code) rpc.Status

New returns an initialized status with the given error code.

func PackErrorDetail Uses

func PackErrorDetail(response proto.Message) *types.Any

PackErrorDetail packs an HTTP response error detail

func String Uses

func String(status rpc.Status) string

String produces a string representation of rpc.Status.

func WithAborted Uses

func WithAborted(message string) rpc.Status

WithAborted returns an initialized status with the rpc.ABORTED code and the given message.

func WithAlreadyExists Uses

func WithAlreadyExists(message string) rpc.Status

WithAlreadyExists returns an initialized status with the rpc.ALREADY_EXISTS code and the given message.

func WithCancelled Uses

func WithCancelled(message string) rpc.Status

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

func WithDataLoss Uses

func WithDataLoss(message string) rpc.Status

WithDataLoss returns an initialized status with the rpc.DATA_LOSS code and the given message.

func WithDeadlineExceeded Uses

func WithDeadlineExceeded(message string) rpc.Status

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

func WithError Uses

func WithError(err error) rpc.Status

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

func WithFailedPrecondition Uses

func WithFailedPrecondition(message string) rpc.Status

WithFailedPrecondition returns an initialized status with the rpc.FAILED_PRECONDITION code and the given message.

func WithInternal Uses

func WithInternal(message string) rpc.Status

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

func WithInvalidArgument Uses

func WithInvalidArgument(message string) rpc.Status

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

func WithMessage Uses

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

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

func WithNotFound Uses

func WithNotFound(message string) rpc.Status

WithNotFound returns an initialized status with the rpc.NOT_FOUND code and the given message.

func WithOutOfRange Uses

func WithOutOfRange(message string) rpc.Status

WithOutOfRange returns an initialized status with the rpc.OUT_OF_RANGE code and the given message.

func WithPermissionDenied Uses

func WithPermissionDenied(message string) rpc.Status

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

func WithResourceExhausted Uses

func WithResourceExhausted(message string) rpc.Status

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

func WithUnauthenticated Uses

func WithUnauthenticated(message string) rpc.Status

WithUnauthenticated returns an initialized status with the rpc.UNAUTHENTICATED code and the given message.

func WithUnavailable Uses

func WithUnavailable(message string) rpc.Status

WithUnavailable returns an initialized status with the rpc.UNAVAILABLE code and the given message.

func WithUnimplemented Uses

func WithUnimplemented(message string) rpc.Status

WithUnimplemented returns an initialized status with the rpc.UNIMPLEMENTED code and the given message.

func WithUnknown Uses

func WithUnknown(message string) rpc.Status

WithUnknown returns an initialized status with the rpc.UNKNOWN code and the given message.

Package status imports 5 packages (graph) and is imported by 18 packages. Updated 2019-08-06. Refresh now. Tools for package owners.