nfs

package
v22.11.9 Latest Latest
Warning

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

Go to latest
Published: May 30, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

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 sshapi.Connector
}

Client defines the structure of a Client object

func NewNFSClient

func NewNFSClient(sshconfig sshapi.Connector) (*Client, fail.Error)

NewNFSClient creates a new NFS client instance

func (*Client) Install

func (c *Client) Install(ctx context.Context, svc iaas.Service) fail.Error

Install installs NFS client on remote host

func (*Client) Mount

func (c *Client) Mount(ctx context.Context, svc iaas.Service, 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, svc iaas.Service, 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 sshapi.Connector
	// contains filtered or unexported fields
}

Server getServer structure

func NewServer

func NewServer(svc iaas.Service, sshconfig sshapi.Connector) (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, svc iaas.Service) 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