nfs

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2018 License: Apache-2.0 Imports: 16 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 *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 isntance

func (*Client) Install

func (c *Client) Install() error

Install installs NFS client on remote host

func (*Client) Mount

func (c *Client) Mount(host string, share string, mountPoint string) error

Mount defines a mount of a remote share and mount it

func (*Client) Unmount

func (c *Client) Unmount(host string, share 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
}

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
}

type Server

type Server struct {
	SshConfig *system.SSHConfig
}

Server structure

func NewServer

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

NewServer instanciates a new nfs.Server struct

func (*Server) AddShare

func (s *Server) AddShare(path string, acl string) 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(device, mountPoint, format 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(device 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

Jump to

Keyboard shortcuts

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