Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AsyncSink ¶
type AsyncSink struct {
// contains filtered or unexported fields
}
AsyncSink wraps a Sink with a buffered channel. It ensures that slow sinks do not block the application.
func (*AsyncSink) Emit ¶
func (as *AsyncSink) Emit(e AuditEvent) error
type AuditEvent ¶
type AuditEvent struct {
ID string `json:"id"`
Timestamp time.Time `json:"timestamp"`
Actor string `json:"actor"` // User who performed the action
Role string `json:"role"` // Role of the user
Action Action `json:"action"` // What happened
Resource string `json:"resource"` // Variable/Path affected
OldValue interface{} `json:"old_value"` // Snapshot before change
NewValue interface{} `json:"new_value"` // Snapshot after change
Metadata map[string]string `json:"metadata,omitempty"`
}
AuditEvent represents a single immutable audit record. It is designed for machine parsability (JSON).
type JSONSink ¶
type JSONSink struct {
// contains filtered or unexported fields
}
JSONSink writes events as newline-delimited JSON.
func NewJSONSink ¶
func (*JSONSink) Emit ¶
func (s *JSONSink) Emit(e AuditEvent) error
type MultiSink ¶
type MultiSink struct {
// contains filtered or unexported fields
}
MultiSink dispatches events to multiple destinations (Fan-Out).
func NewMultiSink ¶
func (*MultiSink) Emit ¶
func (ms *MultiSink) Emit(e AuditEvent) error
type Sink ¶
type Sink interface {
Emit(e AuditEvent) error
Close() error
}
Sink is a destination for audit events.
Click to show internal directories.
Click to hide internal directories.