Improve godocs all around

These will be used in the new automated documentation system
This commit is contained in:
Matthew Holt 2019-12-23 12:45:35 -07:00
parent cbb405f6aa
commit 95ed603de7
No known key found for this signature in database
GPG key ID: 2A349DD577D586A5
26 changed files with 388 additions and 99 deletions

View file

@ -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.