aboutsummaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2015-12-15 13:15:33 +0100
committerDimitri Sokolyuk <demon@dim13.org>2015-12-15 13:15:33 +0100
commitc636683a650a2e2604bbbb6510d044f95285ba69 (patch)
tree024a465c143d47faa1b4157c97d70b0ea4ec258e /cmd
parenteeec120ee9f0ef7d4dcd0fcddb96796643ad32c3 (diff)
Move config into daemon section
Diffstat (limited to 'cmd')
-rw-r--r--cmd/acmed/config.go49
1 files changed, 49 insertions, 0 deletions
diff --git a/cmd/acmed/config.go b/cmd/acmed/config.go
new file mode 100644
index 0000000..2e19849
--- /dev/null
+++ b/cmd/acmed/config.go
@@ -0,0 +1,49 @@
+package main
+
+import "github.com/BurntSushi/toml"
+
+type Config struct {
+ Defaults defaults
+ Provider map[string]provider
+ Account map[string]account
+ Hook map[string]hook
+ Desire map[string]desire
+}
+
+type defaults struct {
+ Gracetime string
+ Listen string
+ Provider string
+ Account string
+ Basedir string
+}
+
+type provider struct {
+ Directory string
+}
+
+type account struct {
+ Mail string
+ Phone string
+ Key string
+}
+
+type hook struct {
+ CMD string
+}
+
+type desire struct {
+ Provider string
+ Account string
+ Altnames []string
+ Key string
+ Cert string
+ Webroot string
+ Hooks []string
+}
+
+func LoadConfig(fname string) (*Config, error) {
+ c := &Config{}
+ _, err := toml.DecodeFile(fname, c)
+ return c, err
+}