mount

package
v0.1.0-alpha.27 Latest Latest
Warning

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

Go to latest
Published: May 20, 2019 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UnWithRetry

func UnWithRetry(mountpoint *Point, setters ...Option) (err error)

UnWithRetry attempts to retry an unmount on EBUSY. It will attempt a retry every 100 milliseconds over the course of 5 seconds.

func WithRetry

func WithRetry(mountpoint *Point, setters ...Option) (err error)

WithRetry attempts to retry a mount on EBUSY. It will attempt a retry every 100 milliseconds over the course of 5 seconds.

Types

type Option

type Option func(*Options)

Option is the functional option func.

func WithPrefix

func WithPrefix(o string) Option

WithPrefix is a functional option for setting the mount point prefix.

func WithReadOnly

func WithReadOnly(o bool) Option

WithReadOnly is a functional option for setting the mount point as readonly.

func WithShared

func WithShared(o bool) Option

WithShared is a functional option for setting the mount point as shared.

type Options

type Options struct {
	Prefix   string
	ReadOnly bool
	Shared   bool
}

Options is the functional options struct.

func NewDefaultOptions

func NewDefaultOptions(setters ...Option) *Options

NewDefaultOptions initializes a Options struct with default values.

type Point

type Point struct {
	// contains filtered or unexported fields
}

Point represents a linux mount point.

func NewMountPoint

func NewMountPoint(source string, target string, fstype string, flags uintptr, data string) *Point

NewMountPoint initializes and returns a Point struct.

func (*Point) Data

func (p *Point) Data() string

Data returns the mount points data field.

func (*Point) Flags

func (p *Point) Flags() uintptr

Flags returns the mount points flags field.

func (*Point) Fstype

func (p *Point) Fstype() string

Fstype returns the mount points fstype field.

func (*Point) Source

func (p *Point) Source() string

Source returns the mount points source field.

func (*Point) Target

func (p *Point) Target() string

Target returns the mount points target field.

type PointMap

type PointMap = map[string]*Point

PointMap represents a unique set of mount points.

type Points

type Points struct {
	// contains filtered or unexported fields
}

Points represents an ordered set of mount points.

func NewMountPoints

func NewMountPoints() *Points

NewMountPoints initializes and returns a Points struct.

func (*Points) Get

func (p *Points) Get(key string) (value *Point, ok bool)

Get gets an ordered value.

func (*Points) Iter

func (p *Points) Iter() *PointsIterator

Iter initializes and returns a mount point iterator.

func (*Points) IterRev

func (p *Points) IterRev() *PointsIterator

IterRev initializes and returns a mount point iterator that advances in reverse.

func (*Points) Set

func (p *Points) Set(key string, value *Point)

Set sets an ordered value.

type PointsIterator

type PointsIterator struct {
	// contains filtered or unexported fields
}

PointsIterator represents an iteratable group of mount points.

func (*PointsIterator) Err

func (i *PointsIterator) Err() error

Err returns an error.

func (*PointsIterator) Key

func (i *PointsIterator) Key() string

Key returns the current key.

func (*PointsIterator) Next

func (i *PointsIterator) Next() bool

Next advances the iterator to the next value.

func (*PointsIterator) Value

func (i *PointsIterator) Value() *Point

Value returns current mount point.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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