receipt

package
v0.62.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 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.

func EmitDeliveryRoot added in v0.45.0

func EmitDeliveryRoot(root *fsq.DeliveryRoot, r Receipt) error

EmitDeliveryRoot writes a receipt through an already authorized root.

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 ReadDeliveryRoot added in v0.49.0

func ReadDeliveryRoot(root *fsq.DeliveryRoot, path string) (Receipt, error)

ReadDeliveryRoot reads a receipt through an already authorized queue root.

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 WaitForDeliveryRoot added in v0.45.0

func WaitForDeliveryRoot(root *fsq.DeliveryRoot, msgID, consumer, stage string, timeout, pollInterval time.Duration) (Receipt, error)

WaitForDeliveryRoot polls through the same capability used for delivery so a renamed root cannot redirect receipt observation to another tree.

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