Documentation ¶
Index ¶
- Constants
- func TestAuditOpFromCreatedEvent(t *testing.T)
- func TestAuditOpFromDeletedEvent(t *testing.T)
- func TestAuditOpFromUpdatedEvent(t *testing.T)
- func TestProcessEventSqlComplexTableName(t *testing.T)
- func TestProcessEventSqlEmptyTraceId(t *testing.T)
- func TestProcessEventSqlMultipleEventsManyAttribute(t *testing.T)
- func TestProcessEventSqlMultipleEventsOneAttribute(t *testing.T)
- func TestProcessEventSqlNoEvents(t *testing.T)
- func TestProcessEventSqlSingleEvent(t *testing.T)
- func TestProcessEventSqlWithMultipleModels(t *testing.T)
- type AuditLog
Constants ¶
View Source
const ( Insert = "insert" Update = "update" Delete = "delete" )
Audit operations
View Source
const ( ColumnId = "id" ColumnTableName = "table_name" ColumnOp = "op" ColumnData = "data" ColumnIdentityId = "identity_id" ColumnTraceId = "trace_id" ColumnCreatedAt = "created_at" ColumnEventProcessedAt = "event_processed_at" )
Audit table column names
View Source
const TableName = "keel_audit"
Audit table name
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AuditLog ¶
type AuditLog struct { Id string TableName string Op string Data map[string]any CreatedAt time.Time EventProcessedAt time.Time }
func ProcessEventsFromAuditTrail ¶
func ProcessEventsFromAuditTrail(ctx context.Context, schema *proto.Schema, traceId string) ([]*AuditLog, error)
ProcessEventsFromAuditTrail inspects the audit table for logs which need to be turned into events, updates their event_processed_at column, and then returns them.
Click to show internal directories.
Click to hide internal directories.