aboutsummaryrefslogtreecommitdiff
path: root/cmd/acme/config.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2015-12-06 16:58:36 +0100
committerDimitri Sokolyuk <demon@dim13.org>2015-12-06 16:58:36 +0100
commitb6490b89ad42af8f3e4e6efcc1c335a105b255df (patch)
treedac9a35ea85fd0d4cc09f6098caeea601df953b0 /cmd/acme/config.go
parent7019369606cd9e318e24d88f67784915ef9701ac (diff)
Config stub
Diffstat (limited to 'cmd/acme/config.go')
-rw-r--r--cmd/acme/config.go38
1 files changed, 38 insertions, 0 deletions
diff --git a/cmd/acme/config.go b/cmd/acme/config.go
new file mode 100644
index 0000000..24d7820
--- /dev/null
+++ b/cmd/acme/config.go
@@ -0,0 +1,38 @@
+package main
+
+import (
+ "log"
+
+ "github.com/BurntSushi/toml"
+)
+
+type Config struct {
+ Account Account
+ Want []Want
+ Hook []Hook
+}
+
+type Account struct {
+ Mail string
+ Key string
+ Provider string
+}
+
+type Want struct {
+ Domains []string
+ Cert string
+ Key string
+}
+
+type Hook struct {
+ CMD string
+}
+
+func ReadConfig(fname string) Config {
+ var c Config
+ _, err := toml.DecodeFile(fname, &c)
+ if err != nil {
+ log.Fatal(err)
+ }
+ return c
+}