config

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: MIT Imports: 6 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package config loads and validates .onair.yml. The same shape can be built programmatically by a host - this package exists only for the CLI's zero-code path.

Index

Constants

View Source
const DefaultFileName = ".onair.yml"

DefaultFileName is what Find looks for, walking up from the working directory the way git finds its root.

Variables

This section is empty.

Functions

func Find

func Find(dir string) (string, error)

Find walks up from dir looking for DefaultFileName.

Types

type Component

type Component struct {
	Name string      `yaml:"name"`
	Live *LiveSource `yaml:"live"`
}

Component configures one deployable unit and its live source.

type Environment

type Environment struct {
	// Environment names the GitLab environment whose deployment records are
	// Live for every component here without a live source of its own.
	Environment string      `yaml:"environment"`
	Components  []Component `yaml:"components"`
}

Environment is one deploy target: a named ordered list of components.

type File

type File struct {
	Project     string                `yaml:"project"`
	Forge       Forge                 `yaml:"forge"`
	Attribution onair.AttributionMode `yaml:"attribution"` // off | on | auto (default auto)
	Identities  map[string][]string   `yaml:"identities"`
	// Task decodes through yaml's lowercased field names: pattern, url.
	Task         *onair.TaskConfig      `yaml:"task"`
	Environments map[string]Environment `yaml:"environments"`
}

File is the parsed .onair.yml.

func Load

func Load(path string) (*File, error)

Load reads and validates one config file.

type Forge

type Forge struct {
	Kind    string `yaml:"kind"` // default "gitlab"
	Repo    string `yaml:"repo"`
	Branch  string `yaml:"branch"`   // empty: onair.Collect's default
	BaseURL string `yaml:"base_url"` // default per kind (gitlab.com)
	// TokenEnv names the environment variable holding the API token;
	// default "GITLAB_TOKEN". The token itself never lives in the file.
	TokenEnv string `yaml:"token_env"`
}

Forge names the git host and project.

type LiveSource

type LiveSource struct {
	Probe   string `yaml:"probe"`   // /-/version URL
	Command string `yaml:"command"` // stdout is the answer (see docs/command-contract.md)
	// Environment is a GitLab environment whose newest successful
	// deployment is Live (Recorded confidence).
	Environment string `yaml:"environment"`
}

LiveSource picks at most one live provider. An absent `live` key inherits the environment's deployment records; `live: {}` opts out of them, leaving Assumed = Green. A bare `live:` (YAML null) is rejected, because it reads as either.

Jump to

Keyboard shortcuts

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