-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathconvenience.go
57 lines (45 loc) · 1.82 KB
/
convenience.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package uci
// DefaultTreePath points to the default UCI location.
const DefaultTreePath = "/etc/config"
// defaultTree is a convenient accessor to the UCI default location.
var defaultTree = NewTree(DefaultTreePath)
// LoadConfig delegates to the default tree. See Tree for details.
func LoadConfig(name string, forceReload bool) error {
return defaultTree.LoadConfig(name, forceReload)
}
// Commit delegates to the default tree. See Tree for details.
func Commit() error {
return defaultTree.Commit()
}
// Revert delegates to the default tree. See Tree for details.
func Revert(configs ...string) {
defaultTree.Revert(configs...)
}
// GetSections delegates to the default tree. See Tree for details.
func GetSections(config, secType string) ([]string, error) {
return defaultTree.GetSections(config, secType)
}
// Get delegates to the default tree. See Tree for details.
func Get(config, section, option string) ([]string, bool) {
return defaultTree.Get(config, section, option)
}
// GetLast delegates to the default tree. See Tree for details.
func GetLast(config, section, option string) (string, bool) {
return defaultTree.GetLast(config, section, option)
}
// GetBool delegates to the default tree. See Tree for details.
func GetBool(config, section, option string) (bool, bool) {
return defaultTree.GetBool(config, section, option)
}
// Del delegates to the default tree. See Tree for details.
func Del(config, section, option string) error {
return defaultTree.Del(config, section, option)
}
// AddSection delegates to the default tree. See Tree for details.
func AddSection(config, section, typ string) error {
return defaultTree.AddSection(config, section, typ)
}
// DelSection delegates to the default tree. See Tree for details.
func DelSection(config, section string) error {
return defaultTree.DelSection(config, section)
}