Documentation
¶
Index ¶
- Constants
- func IsConflict(err error) bool
- func IsInternalError(err error) bool
- func IsInvalidError(err error) bool
- func IsInvalidObj(err error) bool
- func IsNodeExist(err error) bool
- func IsNotFound(err error) bool
- func IsUnreachable(err error) bool
- type InternalError
- type InvalidError
- type StorageError
- func NewInvalidObjError(key, msg string) *StorageError
- func NewKeyExistsError(key string, rv int64) *StorageError
- func NewKeyNotFoundError(key string, rv int64) *StorageError
- func NewResourceVersionConflictsError(key string, rv int64) *StorageError
- func NewUnreachableError(key string, rv int64) *StorageError
Constants ¶
const ( ErrCodeKeyNotFound int = iota + 1 ErrCodeKeyExists ErrCodeResourceVersionConflicts ErrCodeInvalidObj ErrCodeUnreachable )
Variables ¶
This section is empty.
Functions ¶
func IsConflict ¶
IsConflict returns true if and only if err is a write conflict.
func IsInternalError ¶
IsInternalError returns true if and only if err is an InternalError.
func IsInvalidError ¶
IsInvalidError returns true if and only if err is an InvalidError.
func IsInvalidObj ¶
IsInvalidObj returns true if and only if err is invalid error
func IsNodeExist ¶
IsNodeExist returns true if and only if err is an node already exist error.
func IsNotFound ¶
IsNotFound returns true if and only if err is "key" not found error.
func IsUnreachable ¶
IsUnreachable returns true if and only if err indicates the server could not be reached.
Types ¶
type InternalError ¶
type InternalError struct {
Reason string
}
InternalError is generated when an error occurs in the storage package, i.e., not from the underlying storage backend (e.g., etcd).
func NewInternalError ¶
func NewInternalError(reason string) InternalError
func NewInternalErrorf ¶
func NewInternalErrorf(format string, a ...interface{}) InternalError
func (InternalError) Error ¶
func (e InternalError) Error() string
type InvalidError ¶
InvalidError is generated when an error caused by invalid API object occurs in the storage package.
func NewInvalidError ¶
func NewInvalidError(errors field.ErrorList) InvalidError
func (InvalidError) Error ¶
func (e InvalidError) Error() string
type StorageError ¶
func NewInvalidObjError ¶
func NewInvalidObjError(key, msg string) *StorageError
func NewKeyExistsError ¶
func NewKeyExistsError(key string, rv int64) *StorageError
func NewKeyNotFoundError ¶
func NewKeyNotFoundError(key string, rv int64) *StorageError
func NewResourceVersionConflictsError ¶
func NewResourceVersionConflictsError(key string, rv int64) *StorageError
func NewUnreachableError ¶
func NewUnreachableError(key string, rv int64) *StorageError
func (*StorageError) Error ¶
func (e *StorageError) Error() string