continuity

package
v0.1.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package continuity defines the stable persistence contract for A-leg / B-leg continuity and attempt lineage used by documentation and optional external tooling.

Store, ALegRecord, and BLegRecord are the public continuity contract; the core implementation in internal/core/b2bua implements this contract (same field names, types, and Store method set), not vice versa. Drift is caught by the boundary assertions in TestContinuityContract_* (internal/core/b2bua/store_contract_test.go), which compare both directions reflectively.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ALegRecord

type ALegRecord struct {
	ALegID                string
	ContinuityKey         string
	CreatedAt             time.Time
	LastSeenAt            time.Time
	WeightedFirstConsumed bool
}

ALegRecord is the logical client session row for routing and lineage.

type BLegRecord

type BLegRecord struct {
	BLegID string
	ALegID string
	Seq    int
}

BLegRecord identifies one backend attempt slot within an A-leg.

type Store

type Store interface {
	ResolveALeg(ctx context.Context, continuityKey string) (ALegRecord, error)
	CreateALeg(ctx context.Context, continuityKey string) (ALegRecord, error)
	FetchALeg(ctx context.Context, aLegID string) (ALegRecord, error)
	SetWeightedFirstConsumed(ctx context.Context, aLegID string, consumed bool) error
	NextBLeg(ctx context.Context, aLegID string) (BLegRecord, error)
	RecordAttempt(ctx context.Context, rec lipapi.AttemptRecord) error
	LoadAttempts(ctx context.Context, aLegID string) ([]lipapi.AttemptRecord, error)
}

Store persists continuity and attempt lineage; internal/core/b2bua.Store implements this public contract (drift guard: TestContinuityContract_StoreInterfaceMatchesSDK).

Jump to

Keyboard shortcuts

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