nfs

package
v4.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 12, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package nfs to mount or unmount filesystem

Package nfs to mount or unmount filesystem

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainSourceDevice

func ContainSourceDevice(ctx context.Context, targetPath, sourceDev string) bool

ContainSourceDevice used to check target path referenced source device is equal sourceDev

Types

type NFS

type NFS struct {
}

NFS to define a local lock when connect or disconnect, in order to preventing mounting and unmounting confusion

func (*NFS) ConnectVolume

func (nfs *NFS) ConnectVolume(ctx context.Context, conn map[string]interface{}) (string, error)

ConnectVolume to mount the source to target path, the source path can be block or nfs Example:

mount /dev/sdb /<target-path>
mount <source-path> /<target-path>

func (*NFS) DisConnectVolume

func (nfs *NFS) DisConnectVolume(ctx context.Context, targetPath string) error

DisConnectVolume to unmount the target path

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL