config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package config defines the on-disk YAML schemas for a goforge workspace and helpers to read and write them.

Index

Constants

View Source
const (
	WorkspaceFile = "workspace.yaml"
	ComponentFile = "component.yaml"
	BaseFile      = "base.yaml"
	ProjectFile   = "project.yaml"
)

File names used throughout a workspace.

Variables

This section is empty.

Functions

func Save

func Save(path string, v any) error

Save marshals v to YAML and writes it to path.

Types

type Base

type Base struct {
	Interface  string            `yaml:"interface,omitempty"`
	WorkerType *model.WorkerType `yaml:"worker_type,omitempty"`
}

Base mirrors base.yaml. A base may optionally declare a worker type.

func LoadBase

func LoadBase(path string) (Base, error)

LoadBase reads base.yaml.

type Component

type Component struct {
	Interface  string           `yaml:"interface,omitempty"`
	WorkerType model.WorkerType `yaml:"worker_type"`
}

Component mirrors component.yaml.

func LoadComponent

func LoadComponent(path string) (Component, error)

LoadComponent reads component.yaml.

type Project

type Project struct {
	Bricks []string `yaml:"bricks"`
}

Project mirrors project.yaml: the bricks the project is declared to include.

func LoadProject

func LoadProject(path string) (Project, error)

LoadProject reads project.yaml.

type TagPatterns

type TagPatterns struct {
	Stable  string `yaml:"stable"`
	Release string `yaml:"release"`
}

TagPatterns configures stable/release point recognition.

type VCS

type VCS struct {
	Name    string `yaml:"name"`
	AutoAdd bool   `yaml:"auto-add"`
}

VCS configures version-control behaviour.

type Workspace

type Workspace struct {
	TopNamespace string      `yaml:"top-namespace"`
	VCS          VCS         `yaml:"vcs"`
	TagPatterns  TagPatterns `yaml:"tag-patterns"`
}

Workspace mirrors workspace.yaml. Projects and bricks are discovered from the filesystem, so they are not listed here.

func DefaultWorkspace

func DefaultWorkspace(topNamespace string) Workspace

DefaultWorkspace returns workspace defaults for a given top namespace.

func LoadWorkspace

func LoadWorkspace(path string) (Workspace, error)

LoadWorkspace reads workspace.yaml.

Jump to

Keyboard shortcuts

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