mirror of
https://github.com/caddyserver/caddy.git
synced 2025-10-19 15:53:17 +00:00
Improve godocs all around
These will be used in the new automated documentation system
This commit is contained in:
parent
cbb405f6aa
commit
95ed603de7
26 changed files with 388 additions and 99 deletions
|
@ -36,7 +36,7 @@ func init() {
|
|||
|
||||
// ConsoleEncoder encodes log entries that are mostly human-readable.
|
||||
type ConsoleEncoder struct {
|
||||
zapcore.Encoder
|
||||
zapcore.Encoder `json:"-"`
|
||||
LogEncoderConfig
|
||||
}
|
||||
|
||||
|
@ -56,8 +56,8 @@ func (ce *ConsoleEncoder) Provision(_ caddy.Context) error {
|
|||
|
||||
// JSONEncoder encodes entries as JSON.
|
||||
type JSONEncoder struct {
|
||||
zapcore.Encoder
|
||||
*LogEncoderConfig
|
||||
zapcore.Encoder `json:"-"`
|
||||
LogEncoderConfig
|
||||
}
|
||||
|
||||
// CaddyModule returns the Caddy module information.
|
||||
|
@ -77,7 +77,7 @@ func (je *JSONEncoder) Provision(_ caddy.Context) error {
|
|||
// LogfmtEncoder encodes log entries as logfmt:
|
||||
// https://www.brandur.org/logfmt
|
||||
type LogfmtEncoder struct {
|
||||
zapcore.Encoder
|
||||
zapcore.Encoder `json:"-"`
|
||||
LogEncoderConfig
|
||||
}
|
||||
|
||||
|
@ -100,9 +100,9 @@ func (lfe *LogfmtEncoder) Provision(_ caddy.Context) error {
|
|||
// for custom, self-encoded log entries that consist of a
|
||||
// single field in the structured log entry.
|
||||
type StringEncoder struct {
|
||||
zapcore.Encoder
|
||||
FieldName string `json:"field,omitempty"`
|
||||
FallbackRaw json.RawMessage `json:"fallback,omitempty" caddy:"namespace=caddy.logging.encoders inline_key=format"`
|
||||
zapcore.Encoder `json:"-"`
|
||||
FieldName string `json:"field,omitempty"`
|
||||
FallbackRaw json.RawMessage `json:"fallback,omitempty" caddy:"namespace=caddy.logging.encoders inline_key=format"`
|
||||
}
|
||||
|
||||
// CaddyModule returns the Caddy module information.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue