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

Method UnmarshalCaddyfile

modules/caddytls/matchers.go:132–150  ·  view source on GitHub ↗

UnmarshalCaddyfile sets up the MatchServerName from Caddyfile tokens. Syntax: sni <domains...>

(d *caddyfile.Dispenser)

Source from the content-addressed store, hash-verified

130//
131// sni <domains...>
132func (m *MatchServerName) UnmarshalCaddyfile(d *caddyfile.Dispenser) error {
133 for d.Next() {
134 wrapper := d.Val()
135
136 // At least one same-line option must be provided
137 if d.CountRemainingArgs() == 0 {
138 return d.ArgErr()
139 }
140
141 *m = append(*m, d.RemainingArgs()...)
142
143 // No blocks are supported
144 if d.NextBlock(d.Nesting()) {
145 return d.Errf("malformed TLS handshake matcher '%s': blocks are not supported", wrapper)
146 }
147 }
148
149 return nil
150}
151
152// MatchRegexp is an embeddable type for matching
153// using regular expressions. It adds placeholders

Callers

nothing calls this directly

Calls 8

ValMethod · 0.80
CountRemainingArgsMethod · 0.80
ArgErrMethod · 0.80
RemainingArgsMethod · 0.80
NextBlockMethod · 0.80
NestingMethod · 0.80
ErrfMethod · 0.80
NextMethod · 0.65

Tested by

no test coverage detected