configreload

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Overview

Package configreload owns typed field-level reloadability policy for runtime configuration changes. The secret-safe reload trigger/result/status vocabulary is declared once in pkg/lipsdk/configreload; this package owns history, sanitization, stage constants, and policy algorithms only. Trigger envelopes never carry paths, YAML, or URLs.

Index

Constants

View Source
const (
	StageRead      = "read"
	StageLoad      = "load"
	StageNoop      = "noop"
	StageClassify  = "classify"
	StageCompile   = "compile"
	StagePrepare   = "prepare"
	StageRetention = "retention"
	StagePublish   = "publish"
	StageRollback  = "rollback"
	StageShutdown  = "shutdown"
	StageBusy      = "busy"
	StageCoalesce  = "coalesce"
	StagePanic     = "panic"
)

Stage names used in ReasonCategory / diagnostics (bounded, non-secret).

View Source
const DefaultStatusHistoryCap = 32

DefaultStatusHistoryCap is the default bounded ring capacity for reload status history.

View Source
const MaxRestartRequiredFields = 32

MaxRestartRequiredFields bounds restart_required_fields (requirement 7.6).

View Source
const RedactedPlaceholder = "[redacted]"

RedactedPlaceholder is the bounded token substituted for secret material.

Variables

This section is empty.

Functions

func MapLoadCategory

func MapLoadCategory(cat string) (sdkreload.ResultCategory, string)

MapLoadCategory maps a known LoadCategory string to a terminal result.

func MapLoadFailure

func MapLoadFailure(err error) (sdkreload.ResultCategory, string)

MapLoadFailure maps effective-load / source-integrity failures to a terminal result category and bounded reason (req 2.10, 3.10). Values are never included.

func MissingClassifications

func MissingClassifications(declared, inventoried []string) []string

MissingClassifications returns declared paths absent from inventoried paths.

func RequiredStartupOverridePaths

func RequiredStartupOverridePaths() []string

RequiredStartupOverridePaths lists fixed CLI/env overrides (req 7.7).

func RequiredTopLevelPaths

func RequiredTopLevelPaths() []string

RequiredTopLevelPaths lists every current YAML top-level Config section.

func SanitizeConfigKey

func SanitizeConfigKey(key string) string

SanitizeConfigKey returns a safe config field path. Values embedded after '=' or opaque segments that look like secrets are replaced.

func SanitizeDSN

func SanitizeDSN(dsn string) string

SanitizeDSN redacts passwords and credential material from DSN-like strings.

func SanitizeFailure

func SanitizeFailure(err error) string

SanitizeFailure returns a bounded, secret-safe failure summary.

func SanitizeOpaqueYAML

func SanitizeOpaqueYAML(node *yaml.Node) string

SanitizeOpaqueYAML returns a bounded description without node values.

func SanitizePanicValue

func SanitizePanicValue(v any) string

SanitizePanicValue returns only a safe type token or redacted placeholder.

func SanitizeURL

func SanitizeURL(raw string) string

SanitizeURL redacts userinfo and credential-bearing query parameters.

func TypedComparatorSections

func TypedComparatorSections() []string

TypedComparatorSections lists every inventoried path covered by a maintained typed comparator in Classify (requirement 7.2 / task 2.2 FieldCoverage).

Types

type ChangeDisposition

type ChangeDisposition string

ChangeDisposition is the Classify outcome for one safe field path.

const (
	ChangeReloadable      ChangeDisposition = "reloadable"
	ChangeRestartRequired ChangeDisposition = "restart_required"
)

type FieldClass

type FieldClass struct {
	Path          string
	Disposition   FieldDisposition
	SecretBearing bool
	Notes         string
}

FieldClass is one inventoried top-level section or startup override. SecretBearing is orthogonal to Disposition; errors never include values.

func Inventory

func Inventory() []FieldClass

Inventory returns the authoritative reloadability classification table.

type FieldDisposition

type FieldDisposition string

FieldDisposition is the maintained inventory disposition for one path. Every inventoried path must set exactly one; there is no implicit default.

const (
	DispositionReloadable  FieldDisposition = "reloadable"
	DispositionStartupOnly FieldDisposition = "startup_only"
	DispositionConditional FieldDisposition = "conditional"
	DispositionMixed       FieldDisposition = "mixed"
)

func (FieldDisposition) Valid

func (d FieldDisposition) Valid() bool

Valid reports whether d is an explicit disposition.

type RestartRequiredError

type RestartRequiredError struct {
	RestartRequiredFields []string
	TotalBlocked          int
}

RestartRequiredError rejects a candidate before generation construction when any restart-required path is present (requirements 3.5, 7.5–7.6).

func (*RestartRequiredError) Error

func (e *RestartRequiredError) Error() string

type SafeChange

type SafeChange struct {
	Path        string
	Disposition ChangeDisposition
}

SafeChange is a value-free description of a classified config difference.

func Classify

func Classify(active, candidate *config.Config) ([]SafeChange, error)

Classify compares active and candidate configs using maintained typed section comparators (requirement 7.2). Mixed reloadable and restart-required diffs reject as one transaction (requirement 3.5).

func ClassifyEffective

func ClassifyEffective(active, candidate *config.EffectiveConfig) ([]SafeChange, error)

ClassifyEffective classifies two effective configs for coordinator use.

type StatusHistory

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

StatusHistory is a process-owned bounded ring of reload history entries. Entry shape is the canonical HistoryEntry from pkg/lipsdk/configreload.

func NewStatusHistory

func NewStatusHistory(n int) *StatusHistory

NewStatusHistory creates a ring with capacity n (defaults to DefaultStatusHistoryCap).

func (*StatusHistory) Append

func (h *StatusHistory) Append(e sdkreload.HistoryEntry)

Append records an entry, dropping the oldest when full.

func (*StatusHistory) Snapshot

func (h *StatusHistory) Snapshot() []sdkreload.HistoryEntry

Snapshot returns a copy of recent entries (oldest first).

Jump to

Keyboard shortcuts

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