globalconfig

package
v0.135.13 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2026 License: BSD-2-Clause Imports: 6 Imported by: 0

Documentation

Overview

Package globalconfig loads and validates the user-level dark-factory configuration from ~/.dark-factory/config.yaml.

Index

Constants

View Source
const DefaultMaxContainers = 3

DefaultMaxContainers is the system-wide container limit when no config is set.

Variables

This section is empty.

Functions

func FileExists added in v0.111.0

func FileExists(ctx context.Context) (bool, error)

FileExists reports whether the global config file (~/.dark-factory/config.yaml) exists. Callers use this only to distinguish "global file present" from "using built-in defaults" in diagnostic logs. - Config file missing → (false, nil) - Home dir lookup fails → (false, wrapped error) - Any other stat error → (false, wrapped error) - File present (any size) → (true, nil)

Types

type GlobalConfig

type GlobalConfig struct {
	MaxContainers int `yaml:"maxContainers"`
}

GlobalConfig holds the user-level dark-factory configuration. It is loaded from ~/.dark-factory/config.yaml once at daemon startup. When the file does not exist or the field is omitted, defaults apply.

func (GlobalConfig) Validate

func (g GlobalConfig) Validate(ctx context.Context) error

Validate validates the GlobalConfig fields.

type Loader

type Loader interface {
	Load(ctx context.Context) (GlobalConfig, error)
}

Loader loads the global dark-factory configuration.

func NewLoader

func NewLoader() Loader

NewLoader creates a Loader that reads from ~/.dark-factory/config.yaml.

Jump to

Keyboard shortcuts

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