Documentation
¶
Index ¶
Constants ¶
View Source
const Schema = `` /* 522-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
func Middleware ¶
func Middleware(logger Logger, actionName string) kit.Middleware
Middleware wraps an Endpoint: measures duration, captures params/result/error, and logs asynchronously via the Logger.
Types ¶
type Entry ¶
type Entry struct {
EntryID string `json:"entry_id"`
Timestamp int64 `json:"timestamp"`
Action string `json:"action"`
Transport string `json:"transport"` // "http" or "mcp_quic"
UserID string `json:"user_id"`
RequestID string `json:"request_id"`
Parameters string `json:"parameters"`
Result string `json:"result"`
Error string `json:"error_message"`
DurationMs int64 `json:"duration_ms"`
Status string `json:"status"` // "success" or "error"
}
Entry records a single action for the audit trail.
type Logger ¶
type Logger interface {
Log(ctx context.Context, entry *Entry) error
LogAsync(entry *Entry)
Close() error
}
Logger writes audit entries to storage.
type Option ¶
type Option func(*SQLiteLogger)
Option configures a SQLiteLogger.
func WithIDGenerator ¶
WithIDGenerator sets a custom ID generator for audit entry IDs.
type SQLiteLogger ¶
type SQLiteLogger struct {
// contains filtered or unexported fields
}
SQLiteLogger writes audit entries to the audit_log table asynchronously.
func NewSQLiteLogger ¶
func NewSQLiteLogger(sqlDB *sql.DB, opts ...Option) *SQLiteLogger
func (*SQLiteLogger) Close ¶
func (l *SQLiteLogger) Close() error
func (*SQLiteLogger) Init ¶
func (l *SQLiteLogger) Init() error
func (*SQLiteLogger) LogAsync ¶
func (l *SQLiteLogger) LogAsync(entry *Entry)
Click to show internal directories.
Click to hide internal directories.