aboutsummaryrefslogtreecommitdiff
path: root/cmd/acmed/config.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/acmed/config.go')
-rw-r--r--cmd/acmed/config.go11
1 files changed, 10 insertions, 1 deletions
diff --git a/cmd/acmed/config.go b/cmd/acmed/config.go
index cc95557..284ae61 100644
--- a/cmd/acmed/config.go
+++ b/cmd/acmed/config.go
@@ -5,6 +5,7 @@ import (
"errors"
"path"
"strings"
+ "time"
"github.com/BurntSushi/toml"
)
@@ -18,7 +19,7 @@ type Config struct {
}
type defaults struct {
- Gracetime string
+ Gracetime duration
Listen string
Provider string
Account string
@@ -139,3 +140,11 @@ func (d desire) Path() string { return d.Key }
func (d desire) Size() int { return d.KeySize }
func (a account) Path() string { return a.Key }
func (a account) Size() int { return a.KeySize }
+
+type duration struct{ time.Duration }
+
+func (d *duration) UnmarshalText(s []byte) error {
+ var err error
+ d.Duration, err = time.ParseDuration(string(s))
+ return err
+}