runtimeconfig

package
v2.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseManagedOverrides

func ParseManagedOverrides(raw string) (map[string]string, error)

ParseManagedOverrides parses a JSON object of managed overrides into normalized strings.

func RejectUnknownKeys

func RejectUnknownKeys(overrides map[string]string, allowlist map[string]struct{}) []string

RejectUnknownKeys returns sorted keys that are not in the provided allowlist.

Types

type KeyState

type KeyState struct {
	Value          string `json:"value"`
	Source         Source `json:"source"`
	RollbackTarget Source `json:"rollback_target,omitempty"`
}

KeyState reports the effective value and source for a managed key.

type LayerInputs

type LayerInputs struct {
	EffectiveValues map[string]string
	Defaults        map[string]string
	RepoSet         map[string]bool
	EnvSet          map[string]bool
	ManagedSet      map[string]bool
	ManagedEnabled  bool
	Authority       string
}

LayerInputs contains the layer state needed to compute a managed config report.

type Mode

type Mode string

Mode identifies whether the runtime is self-managed or externally managed.

const (
	ModeStandalone Mode = "standalone"
	ModeManaged    Mode = "managed"
)

type ProcessDefaults

type ProcessDefaults struct {
	Web       bool
	Worker    bool
	Scheduler bool
	CoLocated bool
}

ProcessDefaults holds fallback process values when report keys are absent.

type ProcessTopology

type ProcessTopology struct {
	Web       ProcessTopologyEntry `json:"web"`
	Worker    ProcessTopologyEntry `json:"worker"`
	Scheduler ProcessTopologyEntry `json:"scheduler"`
	CoLocated ProcessTopologyEntry `json:"co_located"`
}

ProcessTopology reports process topology with managed-source provenance.

func BuildProcessTopology

func BuildProcessTopology(report Report, defaults ProcessDefaults) ProcessTopology

BuildProcessTopology maps process keys from a managed report into typed topology entries.

type ProcessTopologyEntry

type ProcessTopologyEntry struct {
	Enabled bool   `json:"enabled"`
	Source  Source `json:"source"`
}

ProcessTopologyEntry reports one process flag with its source layer.

type Report

type Report struct {
	Mode      Mode                `json:"mode"`
	Authority string              `json:"authority,omitempty"`
	Keys      map[string]KeyState `json:"keys"`
}

Report captures source-of-truth metadata for allowlisted managed keys.

func BuildReport

func BuildReport(input LayerInputs) Report

BuildReport computes per-key source precedence using the standard layer order.

func (Report) IsManagedMode

func (r Report) IsManagedMode() bool

type Source

type Source string

Source identifies which config layer produced a managed key's effective value.

const (
	SourceFrameworkDefault Source = "framework-default"
	SourceAppRepo          Source = "app-repo"
	SourceEnvironment      Source = "environment"
	SourceManagedOverride  Source = "managed-override"
)

Jump to

Keyboard shortcuts

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