auditing

package
v0.388.0-next.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 11, 2024 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

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

This section is empty.

Types

type AuditLog

type AuditLog struct {
	Id               string
	TableName        string
	Op               string
	Data             map[string]any
	CreatedAt        time.Time
	EventProcessedAt time.Time
}

func Previous added in v0.382.0

func Previous(ctx context.Context, log *AuditLog) (*AuditLog, error)

Previous returns the previous log entry for the given data row.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL