aboutsummaryrefslogtreecommitdiff
path: root/cmd/acme/config.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2015-12-06 18:43:34 +0100
committerDimitri Sokolyuk <demon@dim13.org>2015-12-06 18:43:34 +0100
commitc694398da6684e6ed986f6c92a7f35ce8005c27a (patch)
treee37e867fb4d49a66aa119d83a2ee963f5b6c54c3 /cmd/acme/config.go
parente4c8ad0132c4ba03bd651beeaaa7cbb6e3b86eb4 (diff)
Experiment with config
Diffstat (limited to 'cmd/acme/config.go')
-rw-r--r--cmd/acme/config.go17
1 files changed, 7 insertions, 10 deletions
diff --git a/cmd/acme/config.go b/cmd/acme/config.go
index b880c11..c12732f 100644
--- a/cmd/acme/config.go
+++ b/cmd/acme/config.go
@@ -6,12 +6,16 @@ import (
"github.com/BurntSushi/toml"
)
+type Config struct {
+ Account []Account
+}
+
type Account struct {
Mail string
Key string
Provider string
Want []Want
- Hook Hook
+ Hook []Hook
}
type Want struct {
@@ -24,18 +28,11 @@ type Hook struct {
CMD string
}
-func ReadConfig(fname string) Account {
- var c Account
+func ReadConfig(fname string) Config {
+ var c Config
_, err := toml.DecodeFile(fname, &c)
if err != nil {
log.Fatal(err)
}
return c
}
-
-/*
-func main() {
- a := ReadConfig("acme.toml")
- log.Printf("%+v\n", a)
-}
-*/