auditoutbox

package
v0.4.21 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: Apache-2.0 Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package auditoutbox owns the SDK-private lease and fence mechanics for the public audit package's per-app table. Module authors use audit.Record and ms.DrainAudit; exposing this layer would invite competing drainers.

Index

Constants

This section is empty.

Variables

View Source
var ErrLeaseLost = errors.New("mirrorstack/audit: outbox lease was fenced")

ErrLeaseLost means a newer claim owns the row. A stale worker must not acknowledge, retry, or quarantine it.

Functions

func Acknowledge

func Acknowledge(ctx context.Context, q db.Querier, id int64, token string) error

Acknowledge marks a lease delivered only when its rotating token still owns the row.

func Quarantine

func Quarantine(ctx context.Context, q db.Querier, id int64, token, code string) error

Quarantine makes a permanently invalid or exhausted row terminal without deleting the evidence an operator needs to inspect it.

func Retry

func Retry(ctx context.Context, q db.Querier, id int64, token, code string, availableAt time.Time) error

Retry releases a lease at a bounded future time.

Types

type Delivery

type Delivery struct {
	ID          int64
	EventID     string
	OccurredAt  time.Time
	SubjectKind string
	SubjectID   string
	Action      string
	Details     json.RawMessage
	Proof       []byte
	Attempts    int
	LeaseToken  string
}

Delivery is one privately-provenanced outbox row leased for forwarding. Proof is exact canonical invocation JSON and must only be placed back into the platform invocation header; it must never be logged or exposed to module code.

func Claim

func Claim(ctx context.Context, q db.Querier, limit int, leaseUntil time.Time) ([]Delivery, error)

Claim leases the oldest ready rows with SKIP LOCKED. Expired claims are reclaimable and receive a new token, fencing the old worker.

Jump to

Keyboard shortcuts

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