Documentation
¶
Overview ¶
Package trail provides audit trail functionality
Package trail provides audit trail loggers ¶
Package trail provides audit trail management ¶
Package trail provides audit trail utilities
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatTimestamp ¶ added in v0.8.0
FormatTimestamp formats a timestamp for audit logs
func GenerateAuditID ¶ added in v0.8.0
GenerateAuditID generates a unique audit ID
func ValidateAuditLog ¶ added in v0.8.0
ValidateAuditLog validates an audit log entry
Types ¶
type AuditLog ¶
type AuditLog struct {
ID string `json:"id"`
Timestamp time.Time `json:"timestamp"`
Operation string `json:"operation"`
ResourceType string `json:"resource_type"`
ResourceID string `json:"resource_id"`
Description string `json:"description"`
Status string `json:"status"`
IPAddress string `json:"ip_address"`
Details map[string]interface{} `json:"details"`
}
AuditLog represents an audit log entry
type AuditTrail ¶ added in v0.8.0
AuditTrail manages audit logging
func NewAuditTrail ¶ added in v0.8.0
func NewAuditTrail(writer io.Writer) *AuditTrail
NewAuditTrail creates a new audit trail
func (*AuditTrail) Close ¶ added in v0.8.0
func (a *AuditTrail) Close() error
func (*AuditTrail) LogOperation ¶ added in v0.8.0
func (a *AuditTrail) LogOperation(ctx context.Context, log *AuditLog) error
LogOperation logs an operation to the audit trail
type FileLogger ¶
type FileLogger struct {
// contains filtered or unexported fields
}
FileLogger logs audit events to a file
func NewFileLogger ¶
func NewFileLogger(logPath string) (*FileLogger, error)
NewFileLogger creates a new file logger
type Manager ¶ added in v0.8.0
type Manager struct {
// contains filtered or unexported fields
}
Manager manages audit trail operations
func NewManager ¶ added in v0.8.0
NewManager creates a new audit trail manager
func (*Manager) GetTrail ¶ added in v0.8.0
func (m *Manager) GetTrail() *AuditTrail
GetTrail returns the audit trail
type RotatingLogger ¶ added in v0.8.0
type RotatingLogger struct {
// contains filtered or unexported fields
}
RotatingLogger provides log rotation functionality
func NewRotatingLogger ¶ added in v0.8.0
func NewRotatingLogger(basePath string, maxSize int64) *RotatingLogger
NewRotatingLogger creates a new rotating logger
func (*RotatingLogger) Close ¶ added in v0.8.0
func (r *RotatingLogger) Close() error
Close closes the current log file