Documentation
¶
Index ¶
- Variables
- func Mount(driver Driver, remotePath, localPath string) error
- func Unmount(driver Driver, localPath string) error
- type Driver
- type NFSDriver
- type NfsClientValidator
- type Server
- func (c *Server) AddVolume(volumePath string) error
- func (c *Server) Clients() []string
- func (c *Server) ExportNamePath() string
- func (c *Server) ExportPath() string
- func (c *Server) GetDevice(path string) (uint64, error)
- func (c *Server) RemoveVolume(volumePath string) error
- func (c *Server) Restart() error
- func (c *Server) SetClientValidator(validator NfsClientValidator)
- func (c *Server) SetClients(clients ...string)
- func (c *Server) Stop() error
- func (c *Server) Sync() error
Constants ¶
This section is empty.
Variables ¶
var ( // ErrInvalidExportedName is returned when an exported name is not a valid single directory name ErrInvalidExportedName = errors.New("nfs server: invalid exported name") // ErrInvalidBasePath is returned when the local path to export is invalid ErrInvalidBasePath = errors.New("nfs server: invalid base path") // ErrBasePathNotDir is returned when the base path is not a directory ErrBasePathNotDir = errors.New("nfs server: base path not a directory") // ErrInvalidNetwork is returned when the network specifier does not parse in CIDR format ErrInvalidNetwork = errors.New("nfs server: the network value is not CIDR") )
var ErrMalformedNFSMountpoint = errors.New("malformed nfs mountpoint")
ErrMalformedNFSMountpoint is returned when the nfs mountpoint string is malformed
var ErrNfsMountingUnsupported = errors.New("nfs mounting not supported; install nfs-common")
ErrNfsMountingUnsupported is returned when the mount.nfs4 binary is not found
Functions ¶
Types ¶
type Driver ¶
type Driver interface { // Installed determines if the driver is installed on the system Installed() error // Info provides information about the mounted drive // TODO: make output more universal Info(localPath string, info *proc.NFSMountInfo) error // Mount mounts the remote path to local Mount(remotePath, localPath string, timeout time.Duration) error // Unmount force unmounts a volume Unmount(localPath string) error }
type NfsClientValidator ¶
Refine facade.DfsValidator to avoid circular dependencies
type Server ¶
Server manages exporting an NFS mount.
func NewServer ¶
NewServer returns a nfs.Server object that manages the given nfs mounts to configured clients; basePath is the path for volumes, exportedName is the container dir to hold exported volumes
func (*Server) ExportNamePath ¶
Returns the export path name; a combination of the exportsDir and ExportPath
func (*Server) ExportPath ¶
ExportPath returns the external export name; foo for nfs export /exports/foo
func (*Server) GetDevice ¶
Returns the backing device for a given path. Set on the Driver object to make the mount device check testable.
func (*Server) RemoveVolume ¶
VolumeCreated set that path of a volume that should be exported
func (*Server) SetClientValidator ¶
func (c *Server) SetClientValidator(validator NfsClientValidator)
func (*Server) SetClients ¶
SetClients replaces the existing clients with the new clients