-
Notifications
You must be signed in to change notification settings - Fork 328
/
types_drivers_os.go
63 lines (52 loc) · 1.36 KB
/
types_drivers_os.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
package types
// NewOSDriver is a function that constructs a new OSDriver.
type NewOSDriver func() OSDriver
// DeviceMountOpts are options when mounting a device.
type DeviceMountOpts struct {
MountOptions string
MountLabel string
FsType string
Opts Store
}
// DeviceFormatOpts are options when formatting a device.
type DeviceFormatOpts struct {
NewFSType string
OverwriteFS bool
Opts Store
}
// OSDriverManager is the management wrapper for an OSDriver.
type OSDriverManager interface {
OSDriver
// Driver returns the underlying driver.
Driver() OSDriver
}
// OSDriver is the interface implemented by types that provide OS introspection
// and management.
type OSDriver interface {
Driver
// Mounts get a list of mount points for a local device.
Mounts(
ctx Context,
deviceName, mountPoint string,
opts Store) ([]*MountInfo, error)
// Mount mounts a device to a specified path.
Mount(
ctx Context,
deviceName, mountPoint string,
opts *DeviceMountOpts) error
// Unmount unmounts the underlying device from the specified path.
Unmount(
ctx Context,
mountPoint string,
opts Store) error
// IsMounted checks whether a path is mounted or not
IsMounted(
ctx Context,
mountPoint string,
opts Store) (bool, error)
// Format formats a device.
Format(
ctx Context,
deviceName string,
opts *DeviceFormatOpts) error
}