From 1e662262179d326586d2beb849f842b82b7324c4 Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Mon, 30 Sep 2019 09:11:30 -0600 Subject: httpcaddyfile: Add acme_ca and email global options Also add ability to access options from individual unmarshalers through the Helper values --- caddyconfig/httpcaddyfile/directives.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'caddyconfig/httpcaddyfile/directives.go') diff --git a/caddyconfig/httpcaddyfile/directives.go b/caddyconfig/httpcaddyfile/directives.go index 2f89f6d..0d7e0e4 100644 --- a/caddyconfig/httpcaddyfile/directives.go +++ b/caddyconfig/httpcaddyfile/directives.go @@ -80,11 +80,17 @@ func RegisterHandlerDirective(dir string, setupFunc UnmarshalHandlerFunc) { // Caddyfile tokens. type Helper struct { *caddyfile.Dispenser + options map[string]interface{} warnings *[]caddyconfig.Warning matcherDefs map[string]map[string]json.RawMessage parentBlock caddyfile.ServerBlock } +// Option gets the option keyed by name. +func (h Helper) Option(name string) interface{} { + return h.options[name] +} + // Caddyfiles returns the list of config files from // which tokens in the current server block were loaded. func (h Helper) Caddyfiles() []string { -- cgit v1.2.3