storage

package
v0.0.0-...-b479636 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2017 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrCodeKeyNotFound int = iota + 1
	ErrCodeKeyExists
	ErrCodeResourceVersionConflicts
	ErrCodeInvalidObj
	ErrCodeUnreachable
)

Variables

This section is empty.

Functions

func IsConflict

func IsConflict(err error) bool

IsConflict returns true if and only if err is a write conflict.

func IsInternalError

func IsInternalError(err error) bool

IsInternalError returns true if and only if err is an InternalError.

func IsInvalidError

func IsInvalidError(err error) bool

IsInvalidError returns true if and only if err is an InvalidError.

func IsInvalidObj

func IsInvalidObj(err error) bool

IsInvalidObj returns true if and only if err is invalid error

func IsNodeExist

func IsNodeExist(err error) bool

IsNodeExist returns true if and only if err is an node already exist error.

func IsNotFound

func IsNotFound(err error) bool

IsNotFound returns true if and only if err is "key" not found error.

func IsUnreachable

func IsUnreachable(err error) bool

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

type InvalidError struct {
	Errs field.ErrorList
}

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

type StorageError struct {
	Code               int
	Key                string
	ResourceVersion    int64
	AdditionalErrorMsg string
}

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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