Documentation ¶
Index ¶
- type Config
- type StorageClass
- func (s *StorageClass) CheckAndAddBackend(b *storage.StorageBackend) int
- func (s *StorageClass) ConstructExternal() *StorageClassExternal
- func (s *StorageClass) ConstructPersistent() *StorageClassPersistent
- func (s *StorageClass) GetAttributes() map[string]storage_attribute.Request
- func (s *StorageClass) GetBackendStoragePools() map[string][]string
- func (s *StorageClass) GetName() string
- func (s *StorageClass) GetStoragePoolsForProtocol(p config.Protocol) []*storage.StoragePool
- func (s *StorageClass) GetVolumes() []*storage.Volume
- func (s *StorageClass) Matches(storagePool *storage.StoragePool) bool
- func (s *StorageClass) RemovePoolsForBackend(backend *storage.StorageBackend)
- type StorageClassExternal
- type StorageClassPersistent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { //NOTE: Ensure that any changes made to this data structure are reflected // in the Unmarshal method of config.go Version string `json:"version"` Name string `json:"name"` Attributes map[string]storage_attribute.Request `json:"attributes,omitempty"` BackendStoragePools map[string][]string `json:"requiredStorage,omitempty"` }
func (*Config) MarshalJSON ¶
func (*Config) UnmarshalJSON ¶
type StorageClass ¶
type StorageClass struct {
// contains filtered or unexported fields
}
func New ¶
func New(c *Config) *StorageClass
func NewForConfig ¶
func NewForConfig(configJSON string) (*StorageClass, error)
func NewFromPersistent ¶
func NewFromPersistent(persistent *StorageClassPersistent) *StorageClass
func (*StorageClass) CheckAndAddBackend ¶
func (s *StorageClass) CheckAndAddBackend(b *storage.StorageBackend) int
CheckAndAddBackend iterates through each of the storage pools for a given backend. If the pool satisfies the storage class, it adds that pool. Returns the number of storage pools added.
func (*StorageClass) ConstructExternal ¶
func (s *StorageClass) ConstructExternal() *StorageClassExternal
func (*StorageClass) ConstructPersistent ¶
func (s *StorageClass) ConstructPersistent() *StorageClassPersistent
func (*StorageClass) GetAttributes ¶
func (s *StorageClass) GetAttributes() map[string]storage_attribute.Request
func (*StorageClass) GetBackendStoragePools ¶
func (s *StorageClass) GetBackendStoragePools() map[string][]string
func (*StorageClass) GetName ¶
func (s *StorageClass) GetName() string
func (*StorageClass) GetStoragePoolsForProtocol ¶
func (s *StorageClass) GetStoragePoolsForProtocol(p config.Protocol) []*storage.StoragePool
func (*StorageClass) GetVolumes ¶
func (s *StorageClass) GetVolumes() []*storage.Volume
func (*StorageClass) Matches ¶
func (s *StorageClass) Matches(storagePool *storage.StoragePool) bool
func (*StorageClass) RemovePoolsForBackend ¶
func (s *StorageClass) RemovePoolsForBackend(backend *storage.StorageBackend)
type StorageClassExternal ¶
type StorageClassExternal struct { Config *Config StoragePools map[string][]string `json:"storage"` // Backend -> list of StoragePools }
func (*StorageClassExternal) GetName ¶
func (s *StorageClassExternal) GetName() string
type StorageClassPersistent ¶
type StorageClassPersistent struct {
Config *Config `json:"config"`
}
StorageClassPersistent contains the minimal information needed to persist a StorageClass. This exists to give us some flexibility to evolve the struct; it also avoids overloading the semantics of Config and is consistent with StorageBackendExternal.
func (*StorageClassPersistent) GetName ¶
func (s *StorageClassPersistent) GetName() string
Click to show internal directories.
Click to hide internal directories.