manifest

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrMissingRequired indicates a required field or value is missing.
	ErrMissingRequired = errors.New("missing required field")
	// ErrInvalidValue indicates a field has an invalid value.
	ErrInvalidValue = errors.New("invalid value")
)

Functions

func Render

func Render(path string) (string, error)

Render reads the manifest file at the provided path (or discovers it like Load) and returns the YAML content with ${VAR} placeholders interpolated from the current environment. Missing variables are replaced with empty strings and a warning is emitted to stderr.

func RenderWithWarnings

func RenderWithWarnings(path string) (string, []string, error)

RenderWithWarnings reads the manifest file and returns interpolated YAML and the list of missing env var names.

Types

type Application

type Application struct {
	Root        string       `yaml:"root" validate:"required"`
	Files       []string     `yaml:"files"`
	Profiles    []string     `yaml:"profiles"`
	EnvFile     []string     `yaml:"env-file"`
	Environment *Environment `yaml:"environment"`
	Secrets     *Secrets     `yaml:"secrets"`
	Project     *Project     `yaml:"project"`
	EnvInline   []string     `yaml:"-"`
	SopsSecrets []string     `yaml:"-"`
}

type Config

type Config struct {
	Docker       DockerConfig                    `yaml:"docker"`
	Sops         *SopsConfig                     `yaml:"sops"`
	Secrets      *Secrets                        `yaml:"secrets"`
	Environment  *Environment                    `yaml:"environment"`
	Applications map[string]Application          `yaml:"applications" validate:"dive"`
	Networks     map[string]TopLevelResourceSpec `yaml:"networks"`
	Volumes      map[string]TopLevelResourceSpec `yaml:"volumes"`
	Filesets     map[string]FilesetSpec          `yaml:"filesets"`
	BaseDir      string                          `yaml:"-"`
}

Config is the root desired-state structure parsed from YAML.

func Load

func Load(path string) (Config, error)

Load reads and validates configuration from the provided path. When path is empty, it searches for manifest files in this order in the current working directory: dockform.yml, dockform.yaml, Dockform.yml, Dockform.yaml

func LoadWithWarnings

func LoadWithWarnings(path string) (Config, []string, error)

LoadWithWarnings reads and validates configuration and returns missing env var names instead of printing.

type DockerConfig

type DockerConfig struct {
	Context    string `yaml:"context"`
	Identifier string `yaml:"identifier"`
}

type Environment

type Environment struct {
	Files  []string `yaml:"files"`
	Inline []string `yaml:"inline"`
}

Environment holds environment file references

type FilesetSpec

type FilesetSpec struct {
	Source          string   `yaml:"source"`
	TargetVolume    string   `yaml:"target_volume"`
	TargetPath      string   `yaml:"target_path"`
	RestartServices []string `yaml:"restart_services"`
	Exclude         []string `yaml:"exclude"`
	SourceAbs       string   `yaml:"-"`
}

FilesetSpec defines a local directory to sync into a docker volume at a target path.

type Project

type Project struct {
	Name string `yaml:"name"`
}

type Secrets

type Secrets struct {
	Sops []string `yaml:"sops"`
}

Secrets holds secret sources

type SopsAgeConfig

type SopsAgeConfig struct {
	KeyFile string `yaml:"key_file"`
}

type SopsConfig

type SopsConfig struct {
	Age        *SopsAgeConfig `yaml:"age"`
	Recipients []string       `yaml:"recipients"`
}

SopsConfig configures SOPS provider(s)

type TopLevelResourceSpec

type TopLevelResourceSpec struct{}

TopLevelResourceSpec mirrors YAML for volumes/networks.

Jump to

Keyboard shortcuts

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