v1

package
v0.13.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2024 License: Apache-2.0 Imports: 1 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsErr

func IsErr(s Status) bool

Types

type BaseStatus

type BaseStatus struct {
	// contains filtered or unexported fields
}

func NewBaseStatus

func NewBaseStatus(kind Kind, code Code, message string) *BaseStatus

func NewErrorStatus

func NewErrorStatus(err error) *BaseStatus

func NewErrorStatusWithCode

func NewErrorStatusWithCode(code Code, err error) *BaseStatus

func NewErrorStatusWithMsg

func NewErrorStatusWithMsg(code Code, msg string) *BaseStatus

func (*BaseStatus) Code

func (b *BaseStatus) Code() Code

func (*BaseStatus) Kind

func (b *BaseStatus) Kind() Kind

func (*BaseStatus) Message

func (b *BaseStatus) Message() string

func (*BaseStatus) String

func (b *BaseStatus) String() string

type Code

type Code string
const (
	Unknown          Code = "UNKNOWN"
	Unavailable      Code = "UNAVAILABLE"
	Unimplemented    Code = "UNIMPLEMENTED"
	Canceled         Code = "CANCELED"
	InvalidArgument  Code = "INVALID_ARGUMENT"
	NotFound         Code = "NOTFOUND"
	AlreadyExists    Code = "ALREADY_EXISTS"
	PermissionDenied Code = "PERMISSION_DENIED"
	Internal         Code = "INTERNAL"
	Unauthenticated  Code = "UNAUTHENTICATED"
	IllegalManifest  Code = "ILLEGAL_MANIFEST"
)

type Kind

type Kind string
const (
	Error   Kind = "ERROR"
	Warning Kind = "WARNING"
	Info    Kind = "INFO"
)

type Status

type Status interface {
	Kind() Kind
	Code() Code
	Message() string
	String() string
}

Jump to

Keyboard shortcuts

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