audit

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package audit is the durable org-scoped audit trail bounded context. Persistence technology lives in adapters; this package has no DB/HTTP imports.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Summary

func Summary(name, resourceID string) string

Summary builds a short human-readable description for an audit entry.

Types

type Entry

type Entry struct {
	ID             string
	Name           string
	OrganizationID string
	ResourceID     string
	ActorUserID    string
	Summary        string
	Meta           map[string]string
	At             time.Time
}

Entry is the write model persisted after a successful platform mutation.

type Filter

type Filter struct {
	Limit int
	From  *time.Time
	To    *time.Time
	Name  string // exact event name, optional
}

Filter selects audit rows for an organization.

type Record

type Record struct {
	ID             string            `json:"id"`
	Name           string            `json:"name"`
	OrganizationID string            `json:"organization_id"`
	ResourceID     string            `json:"resource_id"`
	ActorUserID    string            `json:"actor_user_id"`
	ActorEmail     string            `json:"actor_email,omitempty"`
	ActorName      string            `json:"actor_name,omitempty"`
	Summary        string            `json:"summary"`
	Meta           map[string]string `json:"meta,omitempty"`
	At             time.Time         `json:"at"`
}

Record is the read model returned by list queries (may include actor join fields).

type Store

type Store interface {
	Insert(ctx context.Context, e Entry) error
	List(ctx context.Context, orgID string, f Filter) ([]Record, error)
}

Store persists and queries audit entries (implemented by infrastructure adapters).

Jump to

Keyboard shortcuts

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