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

Method UnmarshalCaddyfile

modules/caddyhttp/matchers.go:1288–1298  ·  view source on GitHub ↗

UnmarshalCaddyfile implements caddyfile.Unmarshaler.

(d *caddyfile.Dispenser)

Source from the content-addressed store, hash-verified

1286
1287// UnmarshalCaddyfile implements caddyfile.Unmarshaler.
1288func (m *MatchProtocol) UnmarshalCaddyfile(d *caddyfile.Dispenser) error {
1289 // iterate to merge multiple matchers into one
1290 for d.Next() {
1291 var proto string
1292 if !d.Args(&proto) {
1293 return d.Err("expected exactly one protocol")
1294 }
1295 *m = MatchProtocol(proto)
1296 }
1297 return nil
1298}
1299
1300// CELLibrary produces options that expose this matcher for use in CEL
1301// expression matchers.

Callers

nothing calls this directly

Calls 4

MatchProtocolTypeAlias · 0.85
ArgsMethod · 0.80
ErrMethod · 0.80
NextMethod · 0.65

Tested by

no test coverage detected