MCPcopy
hub / github.com/caddyserver/caddy / RegisterDirective

Function RegisterDirective

caddyconfig/httpcaddyfile/directives.go:109–114  ·  view source on GitHub ↗

RegisterDirective registers a unique directive dir with an associated unmarshaling (setup) function. When directive dir is encountered in a Caddyfile, setupFunc will be called to unmarshal its tokens.

(dir string, setupFunc UnmarshalFunc)

Source from the content-addressed store, hash-verified

107// is encountered in a Caddyfile, setupFunc will be called to
108// unmarshal its tokens.
109func RegisterDirective(dir string, setupFunc UnmarshalFunc) {
110 if _, ok := registeredDirectives[dir]; ok {
111 panic("directive " + dir + " already registered")
112 }
113 registeredDirectives[dir] = setupFunc
114}
115
116// RegisterHandlerDirective is like RegisterDirective, but for
117// directives which specifically output only an HTTP handler.

Callers 8

initFunction · 0.92
initFunction · 0.92
initFunction · 0.92
initFunction · 0.92
initFunction · 0.92
initFunction · 0.92
initFunction · 0.85
RegisterHandlerDirectiveFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected