Documentation ¶
Index ¶
- Constants
- type Client
- type EtcdClient
- func (p *EtcdClient) AddBackend(b *storage.StorageBackend) error
- func (p *EtcdClient) AddStorageClass(sc *storage_class.StorageClass) error
- func (p *EtcdClient) AddVolume(vol *storage.Volume) error
- func (p *EtcdClient) AddVolumeTransaction(volTxn *VolumeTransaction) error
- func (p *EtcdClient) Create(key, value string) error
- func (p *EtcdClient) Delete(key string) error
- func (p *EtcdClient) DeleteBackend(backend *storage.StorageBackend) error
- func (p *EtcdClient) DeleteBackends() error
- func (p *EtcdClient) DeleteStorageClass(sc *storage_class.StorageClass) error
- func (p *EtcdClient) DeleteVolume(vol *storage.Volume) error
- func (p *EtcdClient) DeleteVolumeIgnoreNotFound(vol *storage.Volume) error
- func (p *EtcdClient) DeleteVolumeTransaction(volTxn *VolumeTransaction) error
- func (p *EtcdClient) DeleteVolumes() error
- func (p *EtcdClient) GetBackend(backendName string) (*storage.StorageBackendPersistent, error)
- func (p *EtcdClient) GetBackends() ([]*storage.StorageBackendPersistent, error)
- func (p *EtcdClient) GetExistingVolumeTransaction(volTxn *VolumeTransaction) (*VolumeTransaction, error)
- func (p *EtcdClient) GetStorageClass(scName string) (*storage_class.StorageClassPersistent, error)
- func (p *EtcdClient) GetStorageClasses() ([]*storage_class.StorageClassPersistent, error)
- func (p *EtcdClient) GetVolume(volName string) (*storage.VolumeExternal, error)
- func (p *EtcdClient) GetVolumeTransactions() ([]*VolumeTransaction, error)
- func (p *EtcdClient) GetVolumes() ([]*storage.VolumeExternal, error)
- func (p *EtcdClient) Read(key string) (string, error)
- func (p *EtcdClient) ReadKeys(keyPrefix string) ([]string, error)
- func (p *EtcdClient) Set(key, value string) error
- func (p *EtcdClient) Update(key, value string) error
- func (p *EtcdClient) UpdateBackend(b *storage.StorageBackend) error
- func (p *EtcdClient) UpdateVolume(vol *storage.Volume) error
- type InMemoryClient
- func (c *InMemoryClient) AddBackend(b *storage.StorageBackend) error
- func (c *InMemoryClient) AddStorageClass(s *sc.StorageClass) error
- func (c *InMemoryClient) AddVolume(vol *storage.Volume) error
- func (c *InMemoryClient) AddVolumeTransaction(volTxn *VolumeTransaction) error
- func (c *InMemoryClient) ClearAdded()
- func (c *InMemoryClient) DeleteBackend(b *storage.StorageBackend) error
- func (c *InMemoryClient) DeleteBackends() error
- func (c *InMemoryClient) DeleteStorageClass(s *sc.StorageClass) error
- func (c *InMemoryClient) DeleteVolume(vol *storage.Volume) error
- func (c *InMemoryClient) DeleteVolumeIgnoreNotFound(vol *storage.Volume) error
- func (c *InMemoryClient) DeleteVolumeTransaction(volTxn *VolumeTransaction) error
- func (c *InMemoryClient) DeleteVolumes() error
- func (c *InMemoryClient) GetBackend(backendName string) (*storage.StorageBackendPersistent, error)
- func (c *InMemoryClient) GetBackends() ([]*storage.StorageBackendPersistent, error)
- func (c *InMemoryClient) GetExistingVolumeTransaction(volTxn *VolumeTransaction) (*VolumeTransaction, error)
- func (c *InMemoryClient) GetStorageClass(scName string) (*sc.StorageClassPersistent, error)
- func (c *InMemoryClient) GetStorageClasses() ([]*sc.StorageClassPersistent, error)
- func (c *InMemoryClient) GetVolume(volumeName string) (*storage.VolumeExternal, error)
- func (c *InMemoryClient) GetVolumeTransactions() ([]*VolumeTransaction, error)
- func (c *InMemoryClient) GetVolumes() ([]*storage.VolumeExternal, error)
- func (c *InMemoryClient) UpdateBackend(b *storage.StorageBackend) error
- func (c *InMemoryClient) UpdateVolume(vol *storage.Volume) error
- type KeyError
- type VolumeOperation
- type VolumeTransaction
Constants ¶
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) 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) 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
type VolumeOperation ¶
type VolumeOperation string
const ( AddVolume VolumeOperation = "addVolume" DeleteVolume VolumeOperation = "deleteVolume" )
type VolumeTransaction ¶
type VolumeTransaction struct { Config *storage.VolumeConfig Op VolumeOperation }