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

Method UnmarshalCaddyfile

modules/logging/encoders.go:107–117  ·  view source on GitHub ↗

UnmarshalCaddyfile sets up the module from Caddyfile tokens. Syntax: json { <common encoder config subdirectives...> } See the godoc on the LogEncoderConfig type for the syntax of subdirectives that are common to most/all encoders.

(d *caddyfile.Dispenser)

Source from the content-addressed store, hash-verified

105// See the godoc on the LogEncoderConfig type for the syntax of
106// subdirectives that are common to most/all encoders.
107func (je *JSONEncoder) UnmarshalCaddyfile(d *caddyfile.Dispenser) error {
108 d.Next() // consume encoder name
109 if d.NextArg() {
110 return d.ArgErr()
111 }
112 err := je.LogEncoderConfig.UnmarshalCaddyfile(d)
113 if err != nil {
114 return err
115 }
116 return nil
117}
118
119// LogEncoderConfig holds configuration common to most encoders.
120type LogEncoderConfig struct {

Callers

nothing calls this directly

Calls 4

NextArgMethod · 0.80
ArgErrMethod · 0.80
NextMethod · 0.65
UnmarshalCaddyfileMethod · 0.65

Tested by

no test coverage detected