Documentation
¶
Overview ¶
Package liveconfig manages live configuration overrides for model handlers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
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 ¶
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 ¶
IsModelDisabled returns true if the model is currently live-disabled.