Documentation
¶
Index ¶
- func CleanupInterfaceArray(in []interface{}) []interface{}
- func CleanupInterfaceMap(in map[interface{}]interface{}) map[string]interface{}
- func CleanupMapValue(v interface{}) interface{}
- func Create(config *StorageDriverConfig) (driver.IStorageDriver, error)
- func Register(name string, factory StorageDriverFactory)
- type InvalidStorageDriverError
- type StorageDriverConfig
- type StorageDriverFactory
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanupInterfaceArray ¶
func CleanupInterfaceArray(in []interface{}) []interface{}
func CleanupInterfaceMap ¶
func CleanupInterfaceMap(in map[interface{}]interface{}) map[string]interface{}
func CleanupMapValue ¶
func CleanupMapValue(v interface{}) interface{}
func Create ¶
func Create(config *StorageDriverConfig) (driver.IStorageDriver, error)
Create a new storagedriver.StorageDriver with the given name and parameters. To use a driver, the StorageDriverFactory must first be registered with the given name. If no drivers are found, an InvalidStorageDriverError is returned
func Register ¶
func Register(name string, factory StorageDriverFactory)
Register makes a storage driver available by the provided name. If Register is called twice with the same name or if driver factory is nil, it panics. Additionally, it is not concurrency safe. Most Storage Drivers call this function in their init() functions. See the documentation for StorageDriverFactory for more.
Types ¶
type InvalidStorageDriverError ¶
type InvalidStorageDriverError struct {
Name string
}
InvalidStorageDriverError records an attempt to construct an unregistered storage driver
func (InvalidStorageDriverError) Error ¶
func (err InvalidStorageDriverError) Error() string
type StorageDriverConfig ¶
type StorageDriverConfig struct { Driver string `json:"driver"` Location string `json:"location"` Options map[string]interface{} `json:"parameters"` }
func ParseStorageDriverConfig ¶
func ParseStorageDriverConfig(location string, config map[string]interface{}) *StorageDriverConfig
type StorageDriverFactory ¶
type StorageDriverFactory interface { // Create returns a new storage.IStorageDriver with the given parameters // Parameters will vary by driver and may be ignored // Each parameter key must only consist of lowercase letters and numbers Create(config *StorageDriverConfig) (driver.IStorageDriver, error) }
StorageDriverFactory is a factory interface for creating storage.IStorageDriver interfaces Storage drivers should call Register() with a factory to make the driver available by name.