config

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 7, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package config loads and writes the committed skeeper project config.

Index

Constants

View Source
const (
	// Filename is the committed project config file.
	Filename = ".skeeper.yml"
	// NamespaceBranchSegment separates a sidecar namespace from branch-specific
	// sidecar refs.
	NamespaceBranchSegment = "__branches__"
)

Variables

This section is empty.

Functions

func CleanNamespace added in v0.1.1

func CleanNamespace(namespace string) (string, error)

CleanNamespace validates a sidecar namespace and returns its canonical slash-separated form.

func DefaultPatterns

func DefaultPatterns() []string

DefaultPatterns returns the interactive init defaults.

func NormalizePatterns added in v0.1.1

func NormalizePatterns(patterns []string) ([]string, error)

NormalizePatterns validates and canonicalizes doublestar path globs while preserving their order.

func Save

func Save(root string, cfg Config) error

Save writes cfg to .skeeper.yml under root.

Types

type Config

type Config struct {
	Sidecar    string      `yaml:"sidecar"`
	Bootstrap  string      `yaml:"bootstrap,omitempty"`
	Namespaces []Namespace `yaml:"namespaces"`
}

Config describes how a project mirrors spec files into its sidecar repo.

func Load

func Load(root string) (Config, error)

Load reads and validates .skeeper.yml from root.

func (Config) Normalize

func (c Config) Normalize() (Config, error)

Normalize validates cfg and returns the canonical config values that should drive runtime behavior.

func (Config) Validate

func (c Config) Validate() error

Validate checks that the config can drive deterministic v1 behavior.

type Namespace added in v0.1.1

type Namespace struct {
	Name     string   `yaml:"name"`
	Patterns []string `yaml:"patterns"`
	Exclude  []string `yaml:"exclude,omitempty"`
}

Namespace routes a set of project files into one sidecar namespace.

func NormalizeNamespaces added in v0.1.1

func NormalizeNamespaces(namespaces []Namespace) ([]Namespace, error)

NormalizeNamespaces validates and canonicalizes namespace routing rules.

func (Namespace) Includes added in v0.1.1

func (n Namespace) Includes(path string) bool

Includes reports whether path matches namespace's include patterns.

func (Namespace) Owns added in v0.1.1

func (n Namespace) Owns(path string) bool

Owns reports whether path belongs to namespace after applying excludes.

Jump to

Keyboard shortcuts

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