Help us shape the future of Go! Take the 2026 Go Developer Survey

auditapi

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2026 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package auditapi holds what the /site and /api read surfaces of the Audit log share (ADR 0022): cursor and page-size handling, and the customer-facing view of an entry, so the two handler packages map one shape and cannot diverge on masking.

Index

Constants

This section is empty.

Variables

View Source
var ErrBadCursor = errors.New("invalid cursor")

ErrBadCursor is returned for a cursor that is not a positive entry id.

Functions

func NextCursor

func NextCursor(next int64) string

NextCursor renders the cursor of the next page.

func Page

func Page(cursor string) (int64, error)

Page parses the optional cursor (empty starts from the newest entry).

Types

type View

type View struct {
	ID         int64
	OccurredAt time.Time
	ActorKind  string
	ActorID    *string
	ActorName  *string
	Action     string
	TargetType string
	TargetID   *string
	TargetName *string
	Diff       map[string]jx.Raw
	RequestID  *string
	IP         *string
	UserAgent  *string
}

View is an Audit entry as a customer sees it. A Staff member appears only as events.StaffLabel, with no id.

func StaffViewOf

func StaffViewOf(e *ent.AuditEntry) View

StaffViewOf builds the platform console's view: like ViewOf, except that a Service credential is named (the customer sees it as "Sphericon staff").

func ViewOf

func ViewOf(e *ent.AuditEntry) View

ViewOf builds the customer-facing view of a stored entry.

Jump to

Keyboard shortcuts

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