Documentation
¶
Index ¶
- Constants
- func PathExists(path string) (bool, error)
- func UnmountPath(mountPath string, mounter mount.Interface) error
- type AliyunDriver
- func (d *AliyunDriver) AddDiskTag(diskId string, volumeName string) error
- func (d *AliyunDriver) Attach(options Options, node string) *DriverStatus
- func (d *AliyunDriver) Detach(device string, node string) *DriverStatus
- func (d *AliyunDriver) GetVolumeName(options Options) *DriverStatus
- func (d *AliyunDriver) Init() *DriverStatus
- func (d *AliyunDriver) IsAttached(options Options, node string) *DriverStatus
- func (d *AliyunDriver) Mount(dir string, options Options) *DriverStatus
- func (d *AliyunDriver) MountDevice(dir string, device string, options Options) *DriverStatus
- func (d *AliyunDriver) Unmount(dir string) *DriverStatus
- func (d *AliyunDriver) UnmountDevice(dir string) *DriverStatus
- func (d *AliyunDriver) WaitForAttach(device string, options Options) *DriverStatus
- type Driver
- type DriverCapabilities
- type DriverConfig
- type DriverStatus
- type FakeDriver
- func (d *FakeDriver) Attach(options Options, node string) *DriverStatus
- func (d *FakeDriver) Detach(device string, node string) *DriverStatus
- func (d *FakeDriver) GetVolumeName(options Options) *DriverStatus
- func (d *FakeDriver) Init() *DriverStatus
- func (d *FakeDriver) IsAttached(options Options, node string) *DriverStatus
- func (d *FakeDriver) Mount(dir string, options Options) *DriverStatus
- func (d *FakeDriver) MountDevice(dir string, device string, options Options) *DriverStatus
- func (d *FakeDriver) Unmount(dir string) *DriverStatus
- func (d *FakeDriver) UnmountDevice(dir string) *DriverStatus
- func (d *FakeDriver) WaitForAttach(device string, options Options) *DriverStatus
- type Options
Constants ¶
View Source
const ( // StatusSuccess represents the successful completion of command. StatusSuccess = "Success" // StatusFailed represents that the command failed. StatusFailure = "Failed" // StatusNotSupported represents that the command is not supported. StatusNotSupported = "Not supported" )
View Source
const (
CapabilityAttach = "attach"
)
Variables ¶
This section is empty.
Functions ¶
func PathExists ¶
PathExists returns true if the specified path exists.
Types ¶
type AliyunDriver ¶
type AliyunDriver struct {
// contains filtered or unexported fields
}
func (*AliyunDriver) AddDiskTag ¶ added in v1.2.0
func (d *AliyunDriver) AddDiskTag(diskId string, volumeName string) error
func (*AliyunDriver) Attach ¶
func (d *AliyunDriver) Attach(options Options, node string) *DriverStatus
func (*AliyunDriver) Detach ¶
func (d *AliyunDriver) Detach(device string, node string) *DriverStatus
func (*AliyunDriver) GetVolumeName ¶
func (d *AliyunDriver) GetVolumeName(options Options) *DriverStatus
func (*AliyunDriver) Init ¶
func (d *AliyunDriver) Init() *DriverStatus
func (*AliyunDriver) IsAttached ¶
func (d *AliyunDriver) IsAttached(options Options, node string) *DriverStatus
func (*AliyunDriver) Mount ¶
func (d *AliyunDriver) Mount(dir string, options Options) *DriverStatus
func (*AliyunDriver) MountDevice ¶
func (d *AliyunDriver) MountDevice(dir string, device string, options Options) *DriverStatus
func (*AliyunDriver) Unmount ¶
func (d *AliyunDriver) Unmount(dir string) *DriverStatus
func (*AliyunDriver) UnmountDevice ¶
func (d *AliyunDriver) UnmountDevice(dir string) *DriverStatus
func (*AliyunDriver) WaitForAttach ¶
func (d *AliyunDriver) WaitForAttach(device string, options Options) *DriverStatus
type Driver ¶
type Driver interface {
Init() *DriverStatus
GetVolumeName(options Options) *DriverStatus
Attach(options Options, node string) *DriverStatus
Detach(device string, node string) *DriverStatus
WaitForAttach(device string, options Options) *DriverStatus
IsAttached(options Options, node string) *DriverStatus
MountDevice(dir string, device string, options Options) *DriverStatus
UnmountDevice(dir string) *DriverStatus
Mount(dir string, options Options) *DriverStatus
Unmount(dir string) *DriverStatus
}
func NewDriver ¶
func NewDriver(c *DriverConfig) Driver
func NewFakeDriver ¶
func NewFakeDriver() Driver
type DriverCapabilities ¶ added in v1.2.0
type DriverConfig ¶ added in v1.2.0
type DriverConfig struct {
Region string `json:"region"`
AccessKey string `json:"access_key"`
SecretKey string `json:"secret_key"`
Cluster string `json:"cluster"`
}
func (*DriverConfig) HasAliyunCredentials ¶ added in v1.2.0
func (c *DriverConfig) HasAliyunCredentials() bool
type DriverStatus ¶
type DriverStatus struct {
// Status of the callout. One of "Success", "Failure" or "Not supported".
Status string `json:"status"`
// Reason for success/failure.
Message string `json:"message,omitempty"`
// Path to the device attached. This field is valid only for attach calls.
// ie: /dev/sdx
DevicePath string `json:"device,omitempty"`
// Cluster wide unique name of the volume.
VolumeName string `json:"volumeName,omitempty"`
// Represents volume is attached on the node
Attached bool `json:"attached,omitempty"`
// Driver capabilities
Capabilities DriverCapabilities `json:"capabilities,omitempty"`
}
DriverStatus represents the return value of the driver callout.
func NewDriverError ¶
func NewDriverError(err error) *DriverStatus
func NewDriverNotSupported ¶
func NewDriverNotSupported(err error) *DriverStatus
type FakeDriver ¶
type FakeDriver struct{}
func (*FakeDriver) Attach ¶
func (d *FakeDriver) Attach(options Options, node string) *DriverStatus
func (*FakeDriver) Detach ¶
func (d *FakeDriver) Detach(device string, node string) *DriverStatus
func (*FakeDriver) GetVolumeName ¶
func (d *FakeDriver) GetVolumeName(options Options) *DriverStatus
func (*FakeDriver) Init ¶
func (d *FakeDriver) Init() *DriverStatus
func (*FakeDriver) IsAttached ¶
func (d *FakeDriver) IsAttached(options Options, node string) *DriverStatus
func (*FakeDriver) Mount ¶
func (d *FakeDriver) Mount(dir string, options Options) *DriverStatus
func (*FakeDriver) MountDevice ¶
func (d *FakeDriver) MountDevice(dir string, device string, options Options) *DriverStatus
func (*FakeDriver) Unmount ¶
func (d *FakeDriver) Unmount(dir string) *DriverStatus
func (*FakeDriver) UnmountDevice ¶
func (d *FakeDriver) UnmountDevice(dir string) *DriverStatus
func (*FakeDriver) WaitForAttach ¶
func (d *FakeDriver) WaitForAttach(device string, options Options) *DriverStatus
Click to show internal directories.
Click to hide internal directories.