Help us shape the future of Go! Take the 2026 Go Developer Survey

config

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package config loads and validates Synapse workspace files (SYN-12).

Index

Constants

View Source
const (
	// CurrentVersion is the only supported synapse.yaml version.
	CurrentVersion = 1
	// DefaultFileName is looked up when Load is given a directory.
	DefaultFileName = "synapse.yaml"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Repo

type Repo struct {
	Name string `yaml:"name"`
	Path string `yaml:"path"` // absolute after Load
}

Repo is one workspace member: a logical repo:// name and a local path.

type Workspace

type Workspace struct {
	Version int    `yaml:"version"`
	Repos   []Repo `yaml:"repos"`
	// ConfigPath is the absolute path to the loaded yaml (set by Load).
	ConfigPath string `yaml:"-"`
	// ConfigDir is the directory containing the yaml (paths resolve relative to it).
	ConfigDir string `yaml:"-"`
}

Workspace is a multi-repo Synapse workspace definition.

func Load

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

Load reads a synapse.yaml file or a directory containing one.

func (*Workspace) Lookup

func (ws *Workspace) Lookup(name string) (Repo, error)

Lookup returns the member with the given logical name.

func (*Workspace) RepoRoots

func (ws *Workspace) RepoRoots() map[string]string

RepoRoots returns a map of logical repo name → absolute filesystem root.

Jump to

Keyboard shortcuts

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