Documentation ¶
Index ¶
- func Alias(name, alias string) error
- func AllDriversName() []string
- func Exist(name string) bool
- func Register(d Driver) error
- func Unregister(name string) bool
- type AttachDetach
- type Conf
- type Driver
- type FakeDriver
- func (f *FakeDriver) Create(ctx context.Context, id types.VolumeContext) (*types.Volume, error)
- func (f *FakeDriver) Name(ctx context.Context) string
- func (f *FakeDriver) Path(ctx context.Context, volume *types.Volume) (string, error)
- func (f *FakeDriver) Remove(ctx context.Context, volume *types.Volume) error
- func (f *FakeDriver) StoreMode(ctx context.Context) VolumeStoreMode
- type Formator
- type Getter
- type Lister
- type Opt
- type VolumeStoreMode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllDriversName ¶
func AllDriversName() []string
AllDriversName return all registered backend driver's name.
Types ¶
type AttachDetach ¶
type AttachDetach interface { // Attach a Volume to host, enable the volume. Attach(context.Context, *types.Volume) error // Detach a volume with host, disable the volume. Detach(context.Context, *types.Volume) error }
AttachDetach represents volume attach/detach interface.
type Conf ¶
type Conf interface { // Config is used to pass the daemon volume config into driver. Config(context.Context, map[string]interface{}) error }
Conf represents pass volume config to volume driver.
type Driver ¶
type Driver interface { // Name returns backend driver's name. Name(context.Context) string // StoreMode defines backend driver's store model. StoreMode(context.Context) VolumeStoreMode // Create a volume. Create(context.Context, types.VolumeContext) (*types.Volume, error) // Remove a volume. Remove(context.Context, *types.Volume) error // Path returns volume's path. Path(context.Context, *types.Volume) (string, error) }
Driver represents volume driver base operation interface.
func NewFakeDriver ¶
NewFakeDriver returns a fake voluem driver.
type FakeDriver ¶
type FakeDriver struct {
// contains filtered or unexported fields
}
FakeDriver is a fake volume driver.
func (*FakeDriver) Create ¶
func (f *FakeDriver) Create(ctx context.Context, id types.VolumeContext) (*types.Volume, error)
Create a fake volume
func (*FakeDriver) Name ¶
func (f *FakeDriver) Name(ctx context.Context) string
Name returns the fake driver's name.
func (*FakeDriver) StoreMode ¶
func (f *FakeDriver) StoreMode(ctx context.Context) VolumeStoreMode
StoreMode returns the fake driver's store model.
type Getter ¶
type Getter interface { // Get a volume from driver Get(context.Context, string) (*types.Volume, error) }
Getter represents volume get interface.
type Lister ¶
type Lister interface { // List a volume from driver List(context.Context) ([]*types.Volume, error) }
Lister represents volume list 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.