config

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2026 License: MIT Imports: 14 Imported by: 0 modules, 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 reads and writes install settings: built-in defaults, then <BB_HOME>/config.yaml, then BB_* environment variables, merged with bkit settings.

Index

Constants

View Source
const DefaultDomain = "bb.internal"

DefaultDomain is the default service domain. .internal is reserved for private use and never resolves publicly.

View Source
const EnvPrefix = "BB_"

EnvPrefix marks environment variables that override settings.

View Source
const FormatVersion = 1

FormatVersion is the config.yaml version this build writes.

Variables

View Source
var Keys = []Key{
	{
		Name:    "domain",
		Help:    "DNS domain for service names and certificates; changing it mints a new CA",
		Default: DefaultDomain,
		// contains filtered or unexported fields
	},
}

Keys lists every setting.

Functions

func EnvName

func EnvName(name string) string

EnvName is the environment variable that overrides a key.

Types

type Key

type Key struct {
	Name    string
	Help    string
	Default string
	// contains filtered or unexported fields
}

Key describes one setting.

type Settings

type Settings struct {
	Domain string
}

Settings are the effective install settings.

func Load

func Load(ctx context.Context, home state.Home) (Settings, error)

Load returns the effective settings.

type Value

type Value struct {
	Key    string
	Value  string
	Source string // "default", "config.yaml", or the env var name
	Help   string
}

Value is a setting's effective value and where it came from.

func All

func All(ctx context.Context, home state.Home) ([]Value, error)

All returns every setting.

func Get

func Get(ctx context.Context, home state.Home, name string) (Value, error)

Get returns one setting.

func Set

func Set(ctx context.Context, home state.Home, name, value string) (Value, error)

Set validates and writes one setting to config.yaml, keeping the file's comments. It returns the new value as stored; Source names an environment variable when that variable still overrides the file.

Jump to

Keyboard shortcuts

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