kvstore

package
v0.0.0-...-57f92f0 Latest Latest
Warning

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

Go to latest
Published: May 11, 2017 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MemoryKeyNotFoundError = errors.Errorf("key not found")

	Separator = "/"
)

Functions

This section is empty.

Types

type Backend

type Backend interface {
	Set(key string, obj interface{}) error
	Get(key string, obj interface{}) error
	Delete(key string) error
	Keys(prefix string) ([]string, error)
	IsNotFoundError(err error) bool
}

type ETCDBackend

type ETCDBackend struct {
	Servers []string
	// contains filtered or unexported fields
}

func NewETCDBackend

func NewETCDBackend(servers []string) (*ETCDBackend, error)

func (*ETCDBackend) Delete

func (s *ETCDBackend) Delete(key string) error

func (*ETCDBackend) Get

func (s *ETCDBackend) Get(key string, obj interface{}) error

func (*ETCDBackend) IsNotFoundError

func (s *ETCDBackend) IsNotFoundError(err error) bool

func (*ETCDBackend) Keys

func (s *ETCDBackend) Keys(prefix string) ([]string, error)

func (*ETCDBackend) Set

func (s *ETCDBackend) Set(key string, obj interface{}) error

type KVStore

type KVStore struct {
	Prefix string
	// contains filtered or unexported fields
}

func NewKVStore

func NewKVStore(prefix string, backend Backend) (*KVStore, error)

func (*KVStore) DeleteVolume

func (s *KVStore) DeleteVolume(id string) error

func (*KVStore) DeleteVolumeController

func (s *KVStore) DeleteVolumeController(volumeName string) error

func (*KVStore) DeleteVolumeReplica

func (s *KVStore) DeleteVolumeReplica(volumeName, replicaName string) error

func (*KVStore) DeleteVolumeReplicas

func (s *KVStore) DeleteVolumeReplicas(volumeName string) error

func (*KVStore) GetHost

func (s *KVStore) GetHost(id string) (*types.HostInfo, error)

func (*KVStore) GetSettings

func (s *KVStore) GetSettings() (*types.SettingsInfo, error)

func (*KVStore) GetVolume

func (s *KVStore) GetVolume(id string) (*types.VolumeInfo, error)

func (*KVStore) GetVolumeBase

func (s *KVStore) GetVolumeBase(id string) (*types.VolumeInfo, error)

func (*KVStore) GetVolumeController

func (s *KVStore) GetVolumeController(volumeName string) (*types.ControllerInfo, error)

func (*KVStore) GetVolumeReplica

func (s *KVStore) GetVolumeReplica(volumeName, replicaName string) (*types.ReplicaInfo, error)

func (*KVStore) GetVolumeReplicas

func (s *KVStore) GetVolumeReplicas(volumeName string) (map[string]*types.ReplicaInfo, error)

func (*KVStore) ListHosts

func (s *KVStore) ListHosts() (map[string]*types.HostInfo, error)

func (*KVStore) ListVolumes

func (s *KVStore) ListVolumes() ([]*types.VolumeInfo, error)

func (*KVStore) NewVolumeKeyFromName

func (s *KVStore) NewVolumeKeyFromName(name string) *VolumeKey

func (*KVStore) NewVolumeKeyFromRootKey

func (s *KVStore) NewVolumeKeyFromRootKey(rootKey string) *VolumeKey

func (*KVStore) SetHost

func (s *KVStore) SetHost(host *types.HostInfo) error

func (*KVStore) SetSettings

func (s *KVStore) SetSettings(settings *types.SettingsInfo) error

func (*KVStore) SetVolume

func (s *KVStore) SetVolume(volume *types.VolumeInfo) (err error)

func (*KVStore) SetVolumeBase

func (s *KVStore) SetVolumeBase(volume *types.VolumeInfo) error

func (*KVStore) SetVolumeController

func (s *KVStore) SetVolumeController(controller *types.ControllerInfo) error

func (*KVStore) SetVolumeReplica

func (s *KVStore) SetVolumeReplica(replica *types.ReplicaInfo) error

func (*KVStore) SetVolumeReplicas

func (s *KVStore) SetVolumeReplicas(replicas map[string]*types.ReplicaInfo) error

type MemoryBackend

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

func NewMemoryBackend

func NewMemoryBackend() (*MemoryBackend, error)

func (*MemoryBackend) Delete

func (m *MemoryBackend) Delete(key string) error

func (*MemoryBackend) Get

func (m *MemoryBackend) Get(key string, obj interface{}) error

func (*MemoryBackend) IsNotFoundError

func (m *MemoryBackend) IsNotFoundError(err error) bool

func (*MemoryBackend) Keys

func (m *MemoryBackend) Keys(prefix string) ([]string, error)

func (*MemoryBackend) Set

func (m *MemoryBackend) Set(key string, obj interface{}) error

type VolumeKey

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

func (*VolumeKey) Base

func (k *VolumeKey) Base() string

func (*VolumeKey) Controller

func (k *VolumeKey) Controller() string

func (*VolumeKey) Instances

func (k *VolumeKey) Instances() string

func (*VolumeKey) Replica

func (k *VolumeKey) Replica(replicaName string) string

func (*VolumeKey) Replicas

func (k *VolumeKey) Replicas() string

func (*VolumeKey) RootKey

func (k *VolumeKey) RootKey() string

Jump to

Keyboard shortcuts

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