Documentation
¶
Overview ¶
Package routeoverride holds A-leg-scoped routing-override state and the focused persistence ports used by core runtime and the protected admin adapter. It does not expand b2bua.Store or pkg/lipsdk/continuity.Store.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNotFound reports that the target A-leg does not exist. ErrNotFound = errors.New("routeoverride: a-leg not found") // ErrInvalidSelector reports a selector that fails normalization or bounds. ErrInvalidSelector = errors.New("routeoverride: invalid selector") // ErrRevisionExhausted reports that the next revision would overflow int64. ErrRevisionExhausted = errors.New("routeoverride: revision exhausted") ErrUnavailable = errors.New("routeoverride: store unavailable") // ErrNotImplemented reports that a standard continuity adapter has not yet // gained the optional override capability. ErrNotImplemented = errors.New("routeoverride: store capability is not implemented") )
Functions ¶
func NormalizeSelector ¶
NormalizeSelector trims surrounding whitespace. Empty after trim is inactive input.
Types ¶
type CommandService ¶
type CommandService interface {
Get(ctx context.Context, aLegID string) (State, error)
Replace(ctx context.Context, aLegID, selector string) (State, error)
Clear(ctx context.Context, aLegID string) (State, error)
}
CommandService is the generation-bound application port for admin commands. Persistence stays process-owned; validation is generation-owned.
type SelectorValidator ¶
SelectorValidator is a side-effect-free current-generation route preflight.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is the generation-bound command service. Persistence is process-owned; SelectorValidator is bound to the generation that constructed this instance.
func NewService ¶
NewService constructs a command service. Store and validator are required.
type State ¶
type State struct {
ALegID string
Active bool
Selector string // empty when inactive
Revision int64 // 0 = never mutated
UpdatedAt time.Time
}
State is the revisioned active/inactive routing override for one A-leg.
type Store ¶
type Store interface {
Reader
Get(ctx context.Context, aLegID string) (State, error)
Replace(ctx context.Context, aLegID, selector string, now time.Time) (State, error)
Clear(ctx context.Context, aLegID string, now time.Time) (State, error)
}
Store is the optional continuity capability for revisioned override state. Standard memory and Bun adapters implement this in addition to b2bua.Store without changing the base public continuity contract.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package storecontract holds reusable contract tests for routeoverride.Store implementations (memory, SQLite, PostgreSQL).
|
Package storecontract holds reusable contract tests for routeoverride.Store implementations (memory, SQLite, PostgreSQL). |