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