func (h Helper) Caddyfiles() []string {
	files := make(map[string]struct{})
	for _, segment := range h.parentBlock.Segments {
		for _, token := range segment {
			files[token.File] = struct{}{}
		}
	}
	filesSlice := make([]string, 0, len(files))
	for file := range files {
		filesSlice = append(filesSlice, file)
	}
	return filesSlice
}
Caddyfiles returns the list of config files from
which tokens in the current server block were loaded.
package httpcaddyfile
import (
	"encoding/json"
	"net"
	"sort"
	"strconv"
	"strings"
	"github.com/caddyserver/caddy/v2"
	"github.com/caddyserver/caddy/v2/caddyconfig"
	"github.com/caddyserver/caddy/v2/caddyconfig/caddyfile"
	"github.com/caddyserver/caddy/v2/modules/caddyhttp"
)
var directiveOrder = []string{
	"map",
	"root",
	"header",
	"request_body",
	"redir",
	"rewrite",
	"uri",
	"try_files",
	"basicauth",
	"request_header",
	"encode",
	"push",
	"templates",
	"handle",
	"handle_path",
	"route",
	"abort",
	"error",
	"respond",
	"metrics",
	"reverse_proxy",
	"php_fastcgi",
	"file_server",
	"acme_server",
}
func directiveIsOrdered(dir string) bool {
	for _, d := range directiveOrder {
		if d == dir {
			return true
		}
	}
	return false
}
func RegisterDirective(dir string, setupFunc UnmarshalFunc) {
	if _, ok := registeredDirectives[dir]; ok {
		panic("directive " + dir + " already registered")
	}
	registeredDirectives[dir] = setupFunc
}
func RegisterHandlerDirective(dir string, setupFunc UnmarshalHandlerFunc) {
	RegisterDirective(dir, func(h Helper) ([]ConfigValue, error) {
		if !h.Next() {
			return nil, h.ArgErr()
		}
		matcherSet, err := h.ExtractMatcherSet()
		if err != nil {
			return nil, err
		}
		val, err := setupFunc(h)
		if err != nil {
			return nil, err
		}
		return h.NewRoute(matcherSet, val), nil
	})
}
func RegisterGlobalOption(opt string, setupFunc UnmarshalGlobalFunc) {
	if _, ok := registeredGlobalOptions[opt]; ok {
		panic("global option " + opt + " already registered")
	}
	registeredGlobalOptions[opt] = setupFunc
}
type Helper struct {
	*caddyfile.Dispenser
	State        map[string]interface{}
	options      map[string]interface{}
	warnings     *[]caddyconfig.Warning
	matcherDefs  map[string]caddy.ModuleMap
	parentBlock  caddyfile.ServerBlock
	groupCounter counter
}
func (h Helper) Option(name string) interface{} {
	return h.options[name]
}