Documentation
¶
Overview ¶
Package audit provides a rotating log writer for audit trails.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RotatingWriter ¶
type RotatingWriter struct {
// contains filtered or unexported fields
}
RotatingWriter implements io.Writer with size-based rotation.
func NewRotatingWriter ¶
NewRotatingWriter opens or creates the log file at path. It rotates when the file exceeds maxSize and deletes rotated files older than maxAge.
func (*RotatingWriter) Close ¶
func (w *RotatingWriter) Close() error
Close closes the underlying file.
func (*RotatingWriter) StartCleanup ¶
func (w *RotatingWriter) StartCleanup(ctx context.Context)
StartCleanup runs a background goroutine that deletes rotated files older than maxAge. It checks every hour and stops when ctx is cancelled.
Click to show internal directories.
Click to hide internal directories.