receipt

package
v0.31.3 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StageDrained = "drained"
	StageDLQ     = "dlq"
)

Variables

This section is empty.

Functions

func Emit

func Emit(root string, r Receipt) error

Emit writes a receipt to the consumer's receipts directory. Receipts live only in the consumer namespace; callers that need to observe them must read from the delivery root where the consumer emitted them.

Types

type ListFilter

type ListFilter struct {
	MsgID    string // filter by message ID
	Consumer string // filter by consumer
	Stage    string // filter by stage
}

type Receipt

type Receipt struct {
	Schema    int    `json:"schema"`
	MsgID     string `json:"msg_id"`
	Thread    string `json:"thread,omitempty"`
	Sender    string `json:"sender"`
	Consumer  string `json:"consumer"`
	Stage     string `json:"stage"`
	EmittedAt string `json:"emitted_at"`
	Detail    string `json:"detail,omitempty"`
}

func List

func List(root, agent string, f ListFilter) ([]Receipt, error)

func New

func New(msgID, thread, sender, consumer, stage, detail string) Receipt

func Read

func Read(path string) (Receipt, error)

func WaitFor

func WaitFor(root, msgID, consumer, stage string, timeout, pollInterval time.Duration) (Receipt, error)

WaitFor polls for a specific consumer-local receipt by deterministic filename. Returns the receipt on match, or an error on timeout.

func (Receipt) Marshal

func (r Receipt) Marshal() ([]byte, error)

Jump to

Keyboard shortcuts

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