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

Method UnmarshalCaddyfile

modules/logging/encoders.go:67–77  ·  view source on GitHub ↗

UnmarshalCaddyfile sets up the module from Caddyfile tokens. Syntax: console { <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

65// See the godoc on the LogEncoderConfig type for the syntax of
66// subdirectives that are common to most/all encoders.
67func (ce *ConsoleEncoder) UnmarshalCaddyfile(d *caddyfile.Dispenser) error {
68 d.Next() // consume encoder name
69 if d.NextArg() {
70 return d.ArgErr()
71 }
72 err := ce.LogEncoderConfig.UnmarshalCaddyfile(d)
73 if err != nil {
74 return err
75 }
76 return nil
77}
78
79// JSONEncoder encodes entries as JSON.
80type JSONEncoder 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