audit

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	Action     string
	Resource   string
	ResourceID string
	Before     map[string]any
	After      map[string]any
	IPAddress  string
	UserAgent  string
}

Event describes one audit event payload.

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service persists audit events in best-effort mode.

func NewService

func NewService(client *ent.Client, logger logging.Logger) *Service

NewService creates an audit service.

func (*Service) Record

func (s *Service) Record(ctx context.Context, event Event) error

Record writes an event using identity from context.

func (*Service) RecordWithActor

func (s *Service) RecordWithActor(ctx context.Context, actorID uuid.UUID, tenantID string, event Event) error

RecordWithActor writes an event for specified actor and domain scope.

Jump to

Keyboard shortcuts

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