errors

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsAlreadyExists

func IsAlreadyExists(err error) bool

func IsNotExist

func IsNotExist(err error) bool

func IsUnderDeletion

func IsUnderDeletion(err error) bool

Types

type ErrorStatus

type ErrorStatus struct {
	Reason
}

func AlreadyExist

func AlreadyExist(s string) *ErrorStatus

func NotExist

func NotExist(s string) *ErrorStatus

func UnderDeletion

func UnderDeletion() *ErrorStatus

func (*ErrorStatus) Error

func (e *ErrorStatus) Error() string

func (*ErrorStatus) Status

func (e *ErrorStatus) Status() Reason

type Reason

type Reason struct {
	Message      string
	StatusReason StatusReason
}

type Status

type Status interface {
	Status() Reason
}

type StatusReason

type StatusReason string
const (
	StatusReasonAlreadyExist  StatusReason = "already exist"
	StatusReasonNotExist      StatusReason = "resource not exist"
	StatusReasonUnderDeletion StatusReason = "under deletion"
	StatusReasonUnknown       StatusReason = "unknown"
)

func ReasonForError

func ReasonForError(err error) StatusReason

Jump to

Keyboard shortcuts

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