Documentation ¶
Index ¶
- Constants
- Variables
- func BindMount(source, destination string, readOnly bool, mounter mount.Interface) error
- func GetDeviceFromMount(mounter mount.Interface, mountPath string) (string, error)
- func GetDeviceFromPath(mountPath string) (string, error)
- func ListenerFromUrl(ctx context.Context, endpoint string) (net.Listener, error)
- type VolumeLocks
Constants ¶
View Source
const (
VolumeOperationAlreadyExistsFmt = "An operation with the given Volume ID %s already exists"
)
Variables ¶
View Source
var ErrNoDevice = errors.New("can't find device")
Functions ¶
func GetDeviceFromMount ¶
func GetDeviceFromPath ¶
GetDeviceNameFromMount given a mnt point, find the device from /proc/mounts returns the device name, reference count, and error code.
Types ¶
type VolumeLocks ¶
type VolumeLocks struct {
// contains filtered or unexported fields
}
VolumeLocks implements a map with atomic operations. It stores a set of all volume IDs with an ongoing operation.
func NewVolumeLocks ¶
func NewVolumeLocks() *VolumeLocks
func (*VolumeLocks) Release ¶
func (vl *VolumeLocks) Release(volumeID string)
func (*VolumeLocks) TryAcquire ¶
func (vl *VolumeLocks) TryAcquire(volumeID string) bool
TryAcquire tries to acquire the lock for operating on volumeID and returns true if successful. If another operation is already using volumeID, returns false.
Click to show internal directories.
Click to hide internal directories.