Documentation
¶
Index ¶
- type AuthReader
- type CatalogReader
- type Compiler
- type ConsumerReader
- type Dispatcher
- type DispatcherConfig
- type GatewayReader
- type Holder
- func (h *Holder) Set(raw []byte, version string)
- func (h *Holder) SetPartitioned(raw []byte, version string, scoped map[string]ScopedSnapshot)
- func (h *Holder) Snapshot() (raw []byte, version string, ok bool)
- func (h *Holder) SnapshotFor(scope string) (raw []byte, version string, ok bool)
- func (h *Holder) Version() string
- type PartitionedCompiler
- type PolicyReader
- type RegistryReader
- type RoleReader
- type ScopedSnapshot
- type Signaler
- type SnapshotCompiler
- type SnapshotVersionPublisher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthReader ¶
type AuthReader interface {
List(ctx context.Context, filter authdomain.ListFilter) ([]*authdomain.Auth, int, error)
}
type CatalogReader ¶
type Compiler ¶
type Compiler struct {
// contains filtered or unexported fields
}
func NewCompiler ¶
func NewCompiler( gateways GatewayReader, consumers ConsumerReader, registries RegistryReader, policies PolicyReader, auths AuthReader, roles RoleReader, catalog CatalogReader, logger *slog.Logger, ) *Compiler
func (*Compiler) CompileAll ¶
type ConsumerReader ¶
type Dispatcher ¶
type Dispatcher struct {
// contains filtered or unexported fields
}
Dispatcher compiles the config snapshot, holds it for the gRPC server to serve, broadcasts the new version to connected data planes, and drains the change-marker outbox that survives a control-plane restart. A committed admin write leaves a durable marker; the dispatcher folds every marker visible before the compile into one recompile and drains exactly that observed set.
func NewDispatcher ¶
func NewDispatcher( compiler SnapshotCompiler, codec configsync.SnapshotCodec[*readmodel.Snapshot], holder *Holder, broadcaster configsyncport.VersionBroadcaster, outbox configsyncport.OutboxRepository, logger *slog.Logger, cfg DispatcherConfig, ) *Dispatcher
NewDispatcher builds the control-plane snapshot dispatcher.
func (*Dispatcher) Dispatch ¶
func (d *Dispatcher) Dispatch(ctx context.Context) error
Dispatch runs one dispatch cycle synchronously. It must not run concurrently with Run or another Dispatch: the outbox frontier (MaxSeq/DeleteUpTo) is not mutually exclusive across cycles, so overlapping callers could drain against different frontiers.
func (*Dispatcher) Run ¶
func (d *Dispatcher) Run(ctx context.Context) error
Run drives the dispatch loop until ctx is cancelled: a debounced dispatch after a Signal burst, a jittered backstop dispatch, and an initial catch-up when the outbox holds markers left by a write that committed before a prior restart.
func (*Dispatcher) Signal ¶
func (d *Dispatcher) Signal()
Signal requests a debounced dispatch after an admin write.
type DispatcherConfig ¶
type DispatcherConfig struct {
Debounce time.Duration
Backstop time.Duration
Retention time.Duration
MaxRows int
}
DispatcherConfig tunes the debounce/backstop cadence and the outbox safety bound.
type GatewayReader ¶
type GatewayReader interface {
List(ctx context.Context, filter gatewaydomain.ListFilter) ([]*gatewaydomain.Gateway, int, error)
}
type Holder ¶
type Holder struct {
// contains filtered or unexported fields
}
func (*Holder) SetPartitioned ¶
func (h *Holder) SetPartitioned(raw []byte, version string, scoped map[string]ScopedSnapshot)
func (*Holder) SnapshotFor ¶
type PartitionedCompiler ¶
type PolicyReader ¶
type RegistryReader ¶
type RegistryReader interface {
List(ctx context.Context, filter registrydomain.ListFilter) ([]*registrydomain.Registry, int, error)
}
type RoleReader ¶
type ScopedSnapshot ¶
type SnapshotCompiler ¶
SnapshotCompiler compiles the current State-of-the-World from the live config.
type SnapshotVersionPublisher ¶
type SnapshotVersionPublisher struct {
// contains filtered or unexported fields
}
func NewSnapshotVersionPublisher ¶
func NewSnapshotVersionPublisher(signaler Signaler) *SnapshotVersionPublisher
func (*SnapshotVersionPublisher) Signal ¶
func (p *SnapshotVersionPublisher) Signal(_ context.Context)