package main import ( "log" "github.com/BurntSushi/toml" ) type Config struct { Provider map[string]Provider Account map[string]Account Hook map[string]Hook Desire []Desire } type Provider struct { Directory string } type Account struct { Mail string Key string Provider string } type Desire struct { Altnames []string Key string Cert string Webroot string Account string Gracetime string Hook []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 }