appconfig

package
v0.1.0-alpha.8 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package appconfig parses the per-app zattera.toml (spec §4) into the proto shapes ApplyAppConfig consumes, and computes the deterministic config hash that identifies a release's effective configuration.

The parser is strict: unknown keys are hard errors, durations are TOML strings ("15m") parsed with time.ParseDuration, and every validation failure carries an actionable, dotted-path message (e.g. "env.production.replicas.min > max").

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigHash

func ConfigHash(spec *zatterav1.ServiceSpec, envVarVersion uint64) string

ConfigHash is the deterministic identity of an effective service config: a sha256 over the deterministically-marshaled ServiceSpec plus the env-var version counter. Releases (T-28) and the agent compare it to decide whether a redeploy is needed. Plain proto.Marshal is NOT stable — determinism is required.

Types

type AppConfig

type AppConfig struct {
	Name     string
	Build    *zatterav1.BuildConfig
	GitHub   *zatterav1.GitHubConfig
	Services map[string]*zatterav1.ServiceSpec
	Domains  map[string][]string
	// IdleTimeouts is the scale-to-zero idle window per env (lives on
	// Environment, not ServiceSpec).
	IdleTimeouts map[string]time.Duration
}

AppConfig is the parsed, defaulted result. Build/Services/Domains are exactly what ApplyAppConfigRequest wants; IdleTimeouts carries a field that does not fit into ServiceSpec. A prebuilt image ref lives on Build.Image.

func Parse

func Parse(data []byte) (*AppConfig, error)

Parse reads a zattera.toml document.

Jump to

Keyboard shortcuts

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