Compare commits

..

3 Commits

Author SHA1 Message Date
amery b33dd35bdc build-sys: use local asciigoat.org/ini
Signed-off-by: Alejandro Mery <amery@jpi.io>
2023-09-04 16:07:32 +00:00
amery 6143dd8d3a vscode: add special words to the dictionary
Signed-off-by: Alejandro Mery <amery@jpi.io>
2023-09-04 16:06:08 +00:00
amery 106c58c5da wireguard: switch from gcfg to asciigoat.org/ini/basic
Signed-off-by: Alejandro Mery <amery@jpi.io>
2023-09-04 16:05:19 +00:00
+6 -11
View File
@@ -8,20 +8,15 @@ import (
"darvaza.org/core"
)
type sectionHandler func(*Config, *basic.Section) error
var sectionMap = map[string]func(*Config, *basic.Section) error{
"Interface": loadInterfaceConfSection,
"Peer": loadPeerConfSection,
}
func loadConfSection(out *Config, src *basic.Section) error {
h, ok := sectionMap[src.Key]
if !ok {
switch src.Key {
case "Interface":
return loadInterfaceConfSection(out, src)
case "Peer":
return loadPeerConfSection(out, src)
default:
return core.Wrapf(fs.ErrInvalid, "unknown section %q", src.Key)
}
return h(out, src)
}
func loadInterfaceConfSection(out *Config, src *basic.Section) error {