Documentation
¶
Overview ¶
Package audit implements structured audit logging to PostgreSQL.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuditLogger ¶
type AuditLogger interface {
Log(ctx context.Context, event Event) error
Query(ctx context.Context, filter QueryFilter) ([]Event, error)
Count(ctx context.Context, filter QueryFilter) (int, error)
}
AuditLogger provides audit logging operations.
type Event ¶
type Event struct {
ID string
TenantID string
UserID string
RequestID string
Action string // e.g., "skill.execute", "model.generate"
Resource string // e.g., "skill/search", "model/claude"
Outcome string // "success", "failure", "timeout"
Duration time.Duration
Metadata map[string]string
Timestamp time.Time
}
Event represents an audit log entry.
type PGAuditLogger ¶
type PGAuditLogger struct {
// contains filtered or unexported fields
}
PGAuditLogger implements AuditLogger using PostgreSQL (in-memory stub).
func NewPGAuditLogger ¶
func NewPGAuditLogger() *PGAuditLogger
NewPGAuditLogger creates a new audit logger.
func (*PGAuditLogger) Count ¶
func (l *PGAuditLogger) Count(ctx context.Context, filter QueryFilter) (int, error)
Count returns the number of events matching the filter.
func (*PGAuditLogger) Log ¶
func (l *PGAuditLogger) Log(ctx context.Context, event Event) error
Log records an audit event.
func (*PGAuditLogger) Query ¶
func (l *PGAuditLogger) Query(ctx context.Context, filter QueryFilter) ([]Event, error)
Query retrieves audit events matching the filter.
Click to show internal directories.
Click to hide internal directories.