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

Function ParseSegmentAsSubroute

caddyconfig/httpcaddyfile/directives.go:344–351  ·  view source on GitHub ↗

ParseSegmentAsSubroute parses the segment such that its subdirectives are themselves treated as directives, from which a subroute is built and returned.

(h Helper)

Source from the content-addressed store, hash-verified

342// are themselves treated as directives, from which a subroute is built
343// and returned.
344func ParseSegmentAsSubroute(h Helper) (caddyhttp.MiddlewareHandler, error) {
345 allResults, err := parseSegmentAsConfig(h)
346 if err != nil {
347 return nil, err
348 }
349
350 return buildSubroute(allResults, h.groupCounter, true)
351}
352
353// parseSegmentAsConfig parses the segment such that its subdirectives
354// are themselves treated as directives, including named matcher definitions,

Callers 6

parseCaddyfileHandlePathFunction · 0.92
extractNamedRoutesMethod · 0.85
parseHandleFunction · 0.85
parseHandleErrorsFunction · 0.85

Calls 2

parseSegmentAsConfigFunction · 0.85
buildSubrouteFunction · 0.85

Tested by

no test coverage detected