persistent_store

package
v17.10.0-beta.0+incomp... Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2017 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KeyErrorMsg = "Unable to find key"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	AddBackend(b *storage.StorageBackend) error
	GetBackend(backendName string) (*storage.StorageBackendPersistent, error)
	UpdateBackend(b *storage.StorageBackend) error
	DeleteBackend(backend *storage.StorageBackend) error
	GetBackends() ([]*storage.StorageBackendPersistent, error)
	DeleteBackends() error

	AddVolume(vol *storage.Volume) error
	GetVolume(volName string) (*storage.VolumeExternal, error)
	UpdateVolume(vol *storage.Volume) error
	DeleteVolume(vol *storage.Volume) error
	DeleteVolumeIgnoreNotFound(vol *storage.Volume) error
	GetVolumes() ([]*storage.VolumeExternal, error)
	DeleteVolumes() error

	AddVolumeTransaction(volTxn *VolumeTransaction) error
	GetVolumeTransactions() ([]*VolumeTransaction, error)
	GetExistingVolumeTransaction(volTxn *VolumeTransaction) (*VolumeTransaction,
		error)
	DeleteVolumeTransaction(volTxn *VolumeTransaction) error

	AddStorageClass(sc *storage_class.StorageClass) error
	GetStorageClass(scName string) (*storage_class.StorageClassPersistent, error)
	GetStorageClasses() ([]*storage_class.StorageClassPersistent, error)
	DeleteStorageClass(sc *storage_class.StorageClass) error
}

type EtcdClient

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

func NewEtcdClient

func NewEtcdClient(etcdIP string) (*EtcdClient, error)

func (*EtcdClient) AddBackend

func (p *EtcdClient) AddBackend(b *storage.StorageBackend) error

This method saves the minimally required backend state to the persistent store

func (*EtcdClient) AddStorageClass

func (p *EtcdClient) AddStorageClass(sc *storage_class.StorageClass) error

func (*EtcdClient) AddVolume

func (p *EtcdClient) AddVolume(vol *storage.Volume) error

This method saves a volume's state to the persistent store

func (*EtcdClient) AddVolumeTransaction

func (p *EtcdClient) AddVolumeTransaction(volTxn *VolumeTransaction) error

This method logs an AddVolume operation

func (*EtcdClient) Create

func (p *EtcdClient) Create(key, value string) error

the abstract CRUD interface

func (*EtcdClient) Delete

func (p *EtcdClient) Delete(key string) error

func (*EtcdClient) DeleteBackend

func (p *EtcdClient) DeleteBackend(backend *storage.StorageBackend) error

This method deletes the backend state on the persistent store

func (*EtcdClient) DeleteBackends

func (p *EtcdClient) DeleteBackends() error

This method deletes all backends

func (*EtcdClient) DeleteStorageClass

func (p *EtcdClient) DeleteStorageClass(sc *storage_class.StorageClass) error

DeleteStorageClass deletes a storage class's state from the persistent store

func (*EtcdClient) DeleteVolume

func (p *EtcdClient) DeleteVolume(vol *storage.Volume) error

This method deletes a volume's state from the persistent store

func (*EtcdClient) DeleteVolumeIgnoreNotFound

func (p *EtcdClient) DeleteVolumeIgnoreNotFound(vol *storage.Volume) error

func (*EtcdClient) DeleteVolumeTransaction

func (p *EtcdClient) DeleteVolumeTransaction(volTxn *VolumeTransaction) error

This method deletes an AddVolume log

func (*EtcdClient) DeleteVolumes

func (p *EtcdClient) DeleteVolumes() error

This method deletes all volumes

func (*EtcdClient) GetBackend

func (p *EtcdClient) GetBackend(backendName string) (*storage.StorageBackendPersistent, error)

This method retrieves a backend from the persistent store

func (*EtcdClient) GetBackends

func (p *EtcdClient) GetBackends() ([]*storage.StorageBackendPersistent, error)

This method retrieves all backends

func (*EtcdClient) GetExistingVolumeTransaction

func (p *EtcdClient) GetExistingVolumeTransaction(
	volTxn *VolumeTransaction,
) (*VolumeTransaction, error)

GetExistingVolumeTransaction returns an existing version of the current volume transaction, if it exists. If no volume transaction with the same key exists, it returns nil.

func (*EtcdClient) GetStorageClass

func (p *EtcdClient) GetStorageClass(scName string) (*storage_class.StorageClassPersistent, error)

func (*EtcdClient) GetStorageClasses

func (p *EtcdClient) GetStorageClasses() ([]*storage_class.StorageClassPersistent, error)

func (*EtcdClient) GetVolume

func (p *EtcdClient) GetVolume(volName string) (*storage.VolumeExternal, error)

This method retrieves a volume's state from the persistent store

func (*EtcdClient) GetVolumeTransactions

func (p *EtcdClient) GetVolumeTransactions() ([]*VolumeTransaction, error)

This method retrieves AddVolume logs

func (*EtcdClient) GetVolumes

func (p *EtcdClient) GetVolumes() ([]*storage.VolumeExternal, error)

This method retrieves all volumes

func (*EtcdClient) Read

func (p *EtcdClient) Read(key string) (string, error)

func (*EtcdClient) ReadKeys

func (p *EtcdClient) ReadKeys(keyPrefix string) ([]string, error)

This method returns all the keys with the designated prefix

func (*EtcdClient) Set

func (p *EtcdClient) Set(key, value string) error

func (*EtcdClient) Update

func (p *EtcdClient) Update(key, value string) error

func (*EtcdClient) UpdateBackend

func (p *EtcdClient) UpdateBackend(b *storage.StorageBackend) error

This method updates the backend state on the persistent store

func (*EtcdClient) UpdateVolume

func (p *EtcdClient) UpdateVolume(vol *storage.Volume) error

This method updates a volume's state on the persistent store

type InMemoryClient

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

func NewInMemoryClient

func NewInMemoryClient() *InMemoryClient

func (*InMemoryClient) AddBackend

func (c *InMemoryClient) AddBackend(b *storage.StorageBackend) error

func (*InMemoryClient) AddStorageClass

func (c *InMemoryClient) AddStorageClass(s *sc.StorageClass) error

func (*InMemoryClient) AddVolume

func (c *InMemoryClient) AddVolume(vol *storage.Volume) error

func (*InMemoryClient) AddVolumeTransaction

func (c *InMemoryClient) AddVolumeTransaction(volTxn *VolumeTransaction) error

func (*InMemoryClient) ClearAdded

func (c *InMemoryClient) ClearAdded()

func (*InMemoryClient) DeleteBackend

func (c *InMemoryClient) DeleteBackend(b *storage.StorageBackend) error

func (*InMemoryClient) DeleteBackends

func (c *InMemoryClient) DeleteBackends() error

func (*InMemoryClient) DeleteStorageClass

func (c *InMemoryClient) DeleteStorageClass(s *sc.StorageClass) error

func (*InMemoryClient) DeleteVolume

func (c *InMemoryClient) DeleteVolume(vol *storage.Volume) error

func (*InMemoryClient) DeleteVolumeIgnoreNotFound

func (c *InMemoryClient) DeleteVolumeIgnoreNotFound(vol *storage.Volume) error

func (*InMemoryClient) DeleteVolumeTransaction

func (c *InMemoryClient) DeleteVolumeTransaction(volTxn *VolumeTransaction) error

func (*InMemoryClient) DeleteVolumes

func (c *InMemoryClient) DeleteVolumes() error

func (*InMemoryClient) GetBackend

func (c *InMemoryClient) GetBackend(backendName string) (*storage.StorageBackendPersistent, error)

func (*InMemoryClient) GetBackends

func (c *InMemoryClient) GetBackends() ([]*storage.StorageBackendPersistent, error)

func (*InMemoryClient) GetExistingVolumeTransaction

func (c *InMemoryClient) GetExistingVolumeTransaction(
	volTxn *VolumeTransaction) (*VolumeTransaction, error,
)

func (*InMemoryClient) GetStorageClass

func (c *InMemoryClient) GetStorageClass(scName string) (
	*sc.StorageClassPersistent, error,
)

func (*InMemoryClient) GetStorageClasses

func (c *InMemoryClient) GetStorageClasses() (
	[]*sc.StorageClassPersistent, error,
)

func (*InMemoryClient) GetVolume

func (c *InMemoryClient) GetVolume(volumeName string) (
	*storage.VolumeExternal, error,
)

func (*InMemoryClient) GetVolumeTransactions

func (c *InMemoryClient) GetVolumeTransactions() ([]*VolumeTransaction, error)

func (*InMemoryClient) GetVolumes

func (c *InMemoryClient) GetVolumes() ([]*storage.VolumeExternal, error)

func (*InMemoryClient) UpdateBackend

func (c *InMemoryClient) UpdateBackend(b *storage.StorageBackend) error

func (*InMemoryClient) UpdateVolume

func (c *InMemoryClient) UpdateVolume(vol *storage.Volume) error

type KeyError

type KeyError struct {
	Key string
}

Used to turn etcd errors into something that callers can understand without having to import the client library

func (KeyError) Error

func (e KeyError) Error() string

type VolumeOperation

type VolumeOperation string
const (
	AddVolume    VolumeOperation = "addVolume"
	DeleteVolume VolumeOperation = "deleteVolume"
)

type VolumeTransaction

type VolumeTransaction struct {
	Config *storage.VolumeConfig
	Op     VolumeOperation
}

Jump to

Keyboard shortcuts

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