Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllDriversName ¶
func AllDriversName() []string
AllDriversName return all backend driver's name.
func ListDriverOption ¶
ListDriverOption return backend driver's options by name.
Types ¶
type AttachDetach ¶
type AttachDetach interface { // Attach a Volume to host, enable the volume. Attach(Context, *types.Volume, *types.Storage) error // Detach a volume with host, disable the volume. Detach(Context, *types.Volume, *types.Storage) error }
AttachDetach represents volume attach/detach interface.
type Context ¶
Context represents driver context struct.
type Driver ¶
type Driver interface { // Name returns backend driver's name. Name(Context) string // StoreMode defines backend driver's store model. StoreMode(Context) VolumeStoreMode // Create a volume. Create(Context, *types.Volume, *types.Storage) error // Remove a volume. Remove(Context, *types.Volume, *types.Storage) error // Path returns volume's path. Path(Context, *types.Volume) (string, error) }
Driver represents volume driver base operation interface.
type Formator ¶
type Formator interface { // Format a volume. Format(Context, *types.Volume, *types.Storage) error }
Formator represents volume format interface.
type GatewayDriver ¶
type GatewayDriver interface { // Report storage cluster status. Report(Context) ([]*types.Storage, error) }
GatewayDriver represents storage gateway interface.
type Opt ¶
type Opt interface { // Options return module customize volume options. Options() map[string]types.Option }
Opt represents volume driver option interface.
type VolumeStoreMode ¶
type VolumeStoreMode int
VolumeStoreMode defines volume store mode type.
const ( // LocalStore defines Local store mode. LocalStore VolumeStoreMode = 1 // RemoteStore defines remote store mode. RemoteStore VolumeStoreMode = 2 // CreateDeleteInCentral defines operate storage on gateway. CreateDeleteInCentral VolumeStoreMode = 4 // UseLocalMetaStore defines store metadata on local host. UseLocalMetaStore VolumeStoreMode = 8 )
func (VolumeStoreMode) CentralCreateDelete ¶
func (m VolumeStoreMode) CentralCreateDelete() bool
CentralCreateDelete checks VolumeStoreMode is center mode of operation or not.
func (VolumeStoreMode) IsLocal ¶
func (m VolumeStoreMode) IsLocal() bool
IsLocal checks VolumeStoreMode is local mode or not.
func (VolumeStoreMode) IsRemote ¶
func (m VolumeStoreMode) IsRemote() bool
IsRemote checks VolumeStoreMode is remote mode or not.
func (VolumeStoreMode) String ¶
func (m VolumeStoreMode) String() string
String returns VolumeStoreMode with string description.
func (VolumeStoreMode) UseLocalMeta ¶
func (m VolumeStoreMode) UseLocalMeta() bool
UseLocalMeta checks VolumeStoreMode is store metadata on local or not.
func (VolumeStoreMode) Valid ¶
func (m VolumeStoreMode) Valid() bool
Valid is used to check VolumeStoreMode is valid or not.