Documentation ¶
Overview ¶
Package fstab parses and serializes linux filesystem mounts information
Index ¶
- type DeviceIdentifierType
- type Mount
- func (mount *Mount) Equals(other *Mount) bool
- func (mount *Mount) IsNFS() bool
- func (mount *Mount) IsSwap() bool
- func (mount *Mount) MntOpsString() (opsstring string)
- func (mount *Mount) PaddedString(paddings ...int) string
- func (mount *Mount) SpecType() (spectype DeviceIdentifierType)
- func (mount *Mount) SpecValue() string
- func (mount *Mount) String() string
- type Mounts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DeviceIdentifierType ¶
type DeviceIdentifierType int
const ( Path DeviceIdentifierType = iota Label DeviceIdentifierType = iota UUID DeviceIdentifierType = iota PartUUID DeviceIdentifierType = iota PartLabel DeviceIdentifierType = iota )
type Mount ¶
type Mount struct { // The block special device or remote filesystem to be mounted Spec string // The mount point for the filesystem File string // The type of the filesystem VfsType string // Mount options associated with the filesystem MntOps map[string]string // Used by dump to determine which filesystems need to be dumped. Freq int // Used by the fsck(8) program to determine the order in which filesystem checks are done at reboot time PassNo int }
Mount represetnts the filesystem info
func ParseLine ¶
ParseLine parses a single line (of an fstab). It will most frequently return a Mount; however, If a parsing error occurs, `err` will be non-nil and provide an error message. If the line is either empy or a comment line, `mount` will also be nil.
func (*Mount) MntOpsString ¶
MntOpsString returns the serialized MntOps value
func (*Mount) PaddedString ¶
PaddedString serializes the objet into fstab format with configurable column width. Each positional argument specifies the width for the column in order. Up to 6 arguments are supported, outstanding arguments will be ignored.
func (*Mount) SpecType ¶
func (mount *Mount) SpecType() (spectype DeviceIdentifierType)
SpecType returns the device identifier type
type Mounts ¶
type Mounts []*Mount
func ParseSystem ¶
ParseSystem parses your system fstab ("/etc/fstab")
func (Mounts) PaddedString ¶
PaddedString serializes a list of mounts to the fstab format with padding.