backend

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: 4 Imported by: 0

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

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.

Types

type BackendError

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

func NewKeyExistsError

func NewKeyExistsError(key string, rv int64) *BackendError

func NewKeyNotFoundError

func NewKeyNotFoundError(key string, rv int64) *BackendError

func (*BackendError) Error

func (e *BackendError) Error() string

type BackendTransformer

type BackendTransformer interface {
	BackendTransformerInitializer(config Config) error
	TransformToBackend(ctx context.Context, data string) (string, error)
	TransformFromBackend(ctx context.Context, data string) (string, error)
}

type Config

type Config struct {
	// ServerList is the list of backend servers to connect with.
	ServerList []string
	// TLS credentials
	KeyFile  string
	CertFile string
	CAFile   string
	Codec    runtime.Codec
	Copier   runtime.ObjectCopier
}

func NewDefaultConfig

func NewDefaultConfig(copier runtime.ObjectCopier, codec runtime.Codec) *Config

type Interface

type Interface interface {
	// Create adds a new object at a key unless it already exists.
	Create(ctx context.Context, key string, obj, out runtime.Object, ttl uint64) error

	Get(ctx context.Context, key string, resourceVersion string, objPtr runtime.Object, ignoreNotFound bool) error

	Delete(ctx context.Context, key string, out runtime.Object, preconditions *metav1.Preconditions) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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