-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fstab.go
33 lines (29 loc) · 867 Bytes
/
fstab.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package narcissus
// Fstab maps a /etc/fstab file
type Fstab struct {
augeasPath string `default:"/files/etc/fstab"`
Comments []struct {
Comment string `narcissus:"."`
} `narcissus:"#comment"`
Entries []FstabEntry `narcissus:"seq"`
}
// FstabEntry maps an Fstab entry
type FstabEntry struct {
augeasPath string
Spec string `narcissus:"spec"`
File string `narcissus:"file"`
Vfstype string `narcissus:"vfstype"`
Opt map[string]FstabOpt `narcissus:"opt"`
Dump int `narcissus:"dump"`
Passno int `narcissus:"passno"`
}
// FstabOpt is an FstabEntry opt
type FstabOpt struct {
Value string `narcissus:"value"`
}
// NewFstab returns a new Fstab structure
func (n *Narcissus) NewFstab() (f *Fstab, err error) {
f = &Fstab{}
err = n.Parse(f)
return
}