Exemple #1
0
func GetHost(c *goconfig.ConfigFile) map[string][]string {
	server := make(map[string][]string)
	host := c.GetKeyList("host")
	for _, v := range host {
		row, _ := c.GetValue("host", v)
		server[strings.Trim(v, "#")] = strings.Split(row, "`")
	}
	return server
}
Exemple #2
0
func GetLocal(c *goconfig.ConfigFile) map[string]string {
	local := make(map[string]string)
	dir := c.GetKeyList("local")
	for _, v := range dir {
		row, _ := c.GetValue("local", v)
		local[strings.Trim(v, "#")] = row
	}
	return local
}
Exemple #3
0
func GetGlobal(c *goconfig.ConfigFile) map[string]string {
	global := make(map[string]string)
	cmds := c.GetKeyList("global")
	for _, v := range cmds {
		row, _ := c.GetValue("global", v)
		global[strings.Trim(v, "#")] = row
	}
	return global
}