repos

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2026 License: EUPL-1.2 Imports: 6 Imported by: 0

Documentation

Overview

Package repos provides functionality for managing multi-repo workspaces. It reads a repos.yaml registry file that defines repositories, their types, dependencies, and metadata.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindRegistry

func FindRegistry() (string, error)

FindRegistry searches for repos.yaml in common locations. It checks: current directory, parent directories, and home directory.

Types

type Registry

type Registry struct {
	Version  int              `yaml:"version"`
	Org      string           `yaml:"org"`
	BasePath string           `yaml:"base_path"`
	Repos    map[string]*Repo `yaml:"repos"`
	Defaults RegistryDefaults `yaml:"defaults"`
}

Registry represents a collection of repositories defined in repos.yaml.

func LoadRegistry

func LoadRegistry(path string) (*Registry, error)

LoadRegistry reads and parses a repos.yaml file.

func ScanDirectory

func ScanDirectory(dir string) (*Registry, error)

ScanDirectory creates a Registry by scanning a directory for git repos. This is used as a fallback when no repos.yaml is found.

func (*Registry) ByType

func (r *Registry) ByType(t string) []*Repo

ByType returns repos filtered by type.

func (*Registry) Get

func (r *Registry) Get(name string) (*Repo, bool)

Get returns a repo by name.

func (*Registry) List

func (r *Registry) List() []*Repo

List returns all repos in the registry.

func (*Registry) TopologicalOrder

func (r *Registry) TopologicalOrder() ([]*Repo, error)

TopologicalOrder returns repos sorted by dependency order. Foundation repos come first, then modules, then products.

type RegistryDefaults

type RegistryDefaults struct {
	CI      string `yaml:"ci"`
	License string `yaml:"license"`
	Branch  string `yaml:"branch"`
}

RegistryDefaults contains default values applied to all repos.

type Repo

type Repo struct {
	Name        string   `yaml:"-"` // Set from map key
	Type        string   `yaml:"type"`
	DependsOn   []string `yaml:"depends_on"`
	Description string   `yaml:"description"`
	Docs        bool     `yaml:"docs"`
	CI          string   `yaml:"ci"`
	Domain      string   `yaml:"domain,omitempty"`
	Clone       *bool    `yaml:"clone,omitempty"` // nil = true, false = skip cloning

	// Computed fields
	Path string `yaml:"-"` // Full path to repo directory
}

Repo represents a single repository in the registry.

func (*Repo) Exists

func (repo *Repo) Exists() bool

Exists checks if the repo directory exists on disk.

func (*Repo) IsGitRepo

func (repo *Repo) IsGitRepo() bool

IsGitRepo checks if the repo directory contains a .git folder.

type RepoType

type RepoType string

RepoType indicates the role of a repository in the ecosystem.

const (
	// RepoTypeFoundation indicates core foundation packages.
	RepoTypeFoundation RepoType = "foundation"
	// RepoTypeModule indicates reusable module packages.
	RepoTypeModule RepoType = "module"
	// RepoTypeProduct indicates end-user product applications.
	RepoTypeProduct RepoType = "product"
	// RepoTypeTemplate indicates starter templates.
	RepoTypeTemplate RepoType = "template"
)

Repository type constants for ecosystem classification.

Jump to

Keyboard shortcuts

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