queue

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package queue propagates correlation metadata through backend-neutral queue metadata maps. New provides Send/Receive; each receipt invokes request identity generation anew. Maps are caller-owned and must be stable for reads/exclusively owned for writes. No queue backend, authentication, acknowledgment, execution, retry, goroutine or cancellation mechanism is introduced.

Deprecated: use github.com/faustbrian/go-correlation/adapters/queue. This package remains supported through the documented compatibility interval.

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidOptions = errors.New("queue correlation: invalid options")

ErrInvalidOptions reports invalid queue propagation configuration.

Functions

This section is empty.

Types

type Adapter

type Adapter struct {
	// contains filtered or unexported fields
}

Adapter explicitly sends and receives queue metadata. Construct with New; shareability depends on the retained Factory generator and caller-owned maps.

func New

func New(factory *correlation.Factory, options Options) (*Adapter, error)

New constructs a queue adapter retaining factory. Nil factory returns ErrInvalidOptions; codec validation errors are returned without recategorizing.

func (*Adapter) Receive

func (adapter *Adapter) Receive(metadata map[string]string, trusted bool) (correlation.Values, error)

Receive creates a fresh delivery-attempt ID. trusted must be explicitly true only after the queue backend's metadata boundary has been authenticated. Nil metadata means absence; metadata is never mutated. Malformed untrusted fields still fail extraction before trust. The received causation field is not reused; accepted inbound request identity becomes the immediate cause.

func (*Adapter) Send

func (adapter *Adapter) Send(metadata map[string]string, parent correlation.Values) (correlation.Values, error)

Send creates a message hop and injects it into an application-owned map. Nil metadata/adapter is invalid; populated selected fields refuse overwrite. Errors return zero Values but consumed generation state is not restored. It does not enqueue or persist a message.

type Options

type Options struct {
	// Codec selects exact metadata names and identifier limits. Empty options
	// choose the root Codec defaults, separately from Factory policy.
	Codec correlation.CodecOptions
}

Options configure queue metadata validation and field names.

Jump to

Keyboard shortcuts

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