liveconfig

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2026 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package liveconfig manages live configuration overrides for model handlers.

Index

Constants

This section is empty.

Variables

View Source
var ErrSnapshotNotSerializable = errors.New("snapshot does not implement baseConfigSerializer")

ErrSnapshotNotSerializable is returned when a snapshot type does not implement the baseConfigSerializer interface.

Functions

This section is empty.

Types

type Applier

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

Applier manages live configuration overrides via Redis. It polls a version counter for cheap change detection and applies overrides to handler configs. It maintains a set of live-disabled model IDs for the scheduler to check.

func NewApplier

func NewApplier(
	dag models.DAGReader,
	cache *admin.CacheManager,
	log logrus.FieldLogger,
) *Applier

NewApplier creates a new Applier and takes a snapshot of every handler's current config (after yaml overrides).

func (*Applier) CheckAndApply

func (l *Applier) CheckAndApply(ctx context.Context) (bool, error)

CheckAndApply checks the version counter and applies overrides if changed. Returns true if overrides were (re-)applied.

func (*Applier) GetBaseConfig

func (l *Applier) GetBaseConfig(modelID string) (json.RawMessage, error)

GetBaseConfig returns the original (pre-override) config for a model as JSON. Returns nil, nil if the model has no base config snapshot.

func (*Applier) IsModelDisabled

func (l *Applier) IsModelDisabled(modelID string) bool

IsModelDisabled returns true if the model is currently live-disabled.

Jump to

Keyboard shortcuts

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