API reference
The authoritative API reference is hosted on pkg.go.dev:
github.com/foomo/auditlog/domain/auditlog—API[Payload],NewAPI,Log/Get/Search..../domain/auditlog/store—Entry[Payload],EntityID,DateTime,Search,Sort,PagedResult[T],EntityWithTTL..../domain/auditlog/repository—AuditLogRepository[Payload],BaseAuditLogRepository[Payload],WithRetention,WithCollectionName..../domain/auditlog/command—CreateEntry, handler + middleware composer..../domain/auditlog/query—Search,Gethandlers + middleware composers..../domain/auditlog/public— read-sideService[Payload](Get,Search)..../domain/auditlog/private— write-sideService[Payload](Log).
API[Payload] methods
go
// Log records an audit entry. The caller owns the entry fields except
// for ID / Timestamp / TTLTime, which the repository fills in when zero.
func (a *API[Payload]) Log(ctx context.Context, entry *storex.Entry[Payload]) error
// Get returns the entry with the given id.
func (a *API[Payload]) Get(ctx context.Context, id storex.EntityID) (*storex.Entry[Payload], error)
// Search returns a page of entries matching the filter.
func (a *API[Payload]) Search(ctx context.Context, qry storex.Search) (*storex.PagedResult[storex.Entry[Payload]], error)For usage-oriented explanations with code examples, see the Guide:
