Documentation
¶
Overview ¶
Package log simulates acceptance while logging only bounded message metadata. It does not deliver mail and never logs recipients, bodies, subjects or keys.
Index ¶
Constants ¶
const DefaultPreviewBytes = 64 << 10
DefaultPreviewBytes bounds each logged body.
Variables ¶
This section is empty.
Functions ¶
func RedactHeader ¶
RedactHeader reports the logged form of one header value.
Types ¶
type PreviewDriver ¶
type PreviewDriver struct {
// contains filtered or unexported fields
}
PreviewDriver is a development transport: it simulates acceptance and logs the rendered message (sender, recipients, subject, locale, headers, text and HTML bodies and attachment metadata) so developers can read mail without a provider. Header values whose names suggest credentials (authorization, token, secret, key, password, signature, cookie, session) are redacted and attachment bytes are never logged. It records private content: use it only in local and development environments.
func NewPreview ¶
func NewPreview(logger *slog.Logger, maxBytes int) (*PreviewDriver, error)
NewPreview logs through logger; maxBytes bounds each body (zero selects DefaultPreviewBytes).