nfs

package
v21.11.0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2022 License: Apache-2.0 Imports: 18 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// SshConfig contains ssh connection configuration
	SSHConfig *system.SSHConfig
}

Client defines the structure of a Client object

func NewNFSClient

func NewNFSClient(sshconfig *system.SSHConfig) (*Client, fail.Error)

NewNFSClient creates a new NFS client instance

func (*Client) Install

func (c *Client) Install(ctx context.Context) fail.Error

Install installs NFS client on remote host

func (*Client) Mount

func (c *Client) Mount(ctx context.Context, export string, mountPoint string, withCache bool) fail.Error

Mount defines a mount of a remote share and mount it

func (*Client) Unmount

func (c *Client) Unmount(ctx context.Context, export string) fail.Error

Unmount a nfs share from NFS server

type ExportACL

type ExportACL struct {
	// Host contains the pattern of hosts authorized (cf. exports man page)
	Host string
	// SecurityMode contains all the security mode allowed for the Host
	SecurityModes []securityflavor.Enum
	// Options contains the options of the export ACL
	Options ExportOptions
}

ExportACL ...

type ExportOptions

type ExportOptions struct {
	ReadOnly       bool
	NoRootSquash   bool
	Secure         bool
	Async          bool
	NoHide         bool
	CrossMount     bool
	NoSubtreeCheck bool
	SetFSID        bool
	AnonUID        int
	AnonGID        int
}

ExportOptions ...

type Server

type Server struct {
	SSHConfig *system.SSHConfig
}

Server getServer structure

func NewServer

func NewServer(sshconfig *system.SSHConfig) (srv *Server, err fail.Error)

NewServer instantiates a new nfs.getServer struct

func (*Server) AddShare

func (s *Server) AddShare(
	ctx context.Context, path string,
	options string,
) fail.Error

AddShare configures a local path to be exported by NFS

func (*Server) Install

func (s *Server) Install(ctx context.Context) fail.Error

Install installs and configure NFS service on the remote host

func (*Server) MountBlockDevice

func (s *Server) MountBlockDevice(
	ctx context.Context, deviceName, mountPoint, format string, doNotFormat bool,
) (string, fail.Error)

MountBlockDevice mounts a block device in the remote system

func (*Server) RemoveShare

func (s *Server) RemoveShare(ctx context.Context, path string) fail.Error

RemoveShare stops export of a local mount point by NFS on the remote server

func (*Server) UnmountBlockDevice

func (s *Server) UnmountBlockDevice(ctx context.Context, volumeUUID string) fail.Error

UnmountBlockDevice unmounts a local block device on the remote system

type Share

type Share struct {
	Server *Server
	Path   string
	// ACLs   []ExportACL
	Options string
}

Share details the parameter of a NFS share

func NewShare

func NewShare(server *Server, path, options string) (*Share, fail.Error)

NewShare creates a share struct corresponding to the export of path on server

func (*Share) Add

func (s *Share) Add(ctx context.Context) fail.Error

Add configures and exports the share

Directories

Path Synopsis
enums

Jump to

Keyboard shortcuts

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