nfs

package
v19.10.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2019 License: Apache-2.0 Imports: 17 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 *system.SSHConfig
}

Client defines the structure of a Client object

func NewNFSClient

func NewNFSClient(sshconfig *system.SSHConfig) (*Client, error)

NewNFSClient creates a new NFS client instance

func (*Client) Install

func (c *Client) Install() error

Install installs NFS client on remote host

func (*Client) Mount

func (c *Client) Mount(export string, mountPoint string, withCache bool) error

Mount defines a mount of a remote share and mount it

func (*Client) Unmount

func (c *Client) Unmount(export string) 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 structure

func NewServer

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

NewServer instantiates a new nfs.Server struct

func (*Server) AddShare

func (s *Server) AddShare(path string, secutityModes []string, readOnly, rootSquash, secure, async, noHide, crossMount, subtreeCheck bool) error

AddShare configures a local path to be exported by NFS

func (*Server) GetHost

func (s *Server) GetHost() string

GetHost returns the hostname or IP address of the nfs.Server

func (*Server) Install

func (s *Server) Install() error

Install installs and configure NFS service on the remote host

func (*Server) MountBlockDevice

func (s *Server) MountBlockDevice(deviceName, mountPoint, format string, doNotFormat bool) (string, error)

MountBlockDevice mounts a block device in the remote system

func (*Server) RemoveShare

func (s *Server) RemoveShare(path string) error

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

func (*Server) UnmountBlockDevice

func (s *Server) UnmountBlockDevice(volumeUUID string) error

UnmountBlockDevice unmounts a local block device on the remote system

type Share

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

Share details the parameter of a NFS share

func NewShare

func NewShare(server *Server, path string) (*Share, error)

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

func (*Share) Add

func (s *Share) Add() error

Add configures and exports the share

func (*Share) AddACL

func (s *Share) AddACL(acl ExportACL)

AddACL adds an ACL to the share

Directories

Path Synopsis
enums

Jump to

Keyboard shortcuts

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