config

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultConfigName = ".repos"
	FormatTOML        = "toml"
	FormatYAML        = "yaml"
)

Variables

This section is empty.

Functions

func ConfigPath

func ConfigPath(dir, format string) string

func DetectFormat

func DetectFormat(path string) string

func EnsureConfig

func EnsureConfig(rootDir, format string) (string, error)

func FindConfigFile

func FindConfigFile(dir string) (string, error)

func RepoNameFromPath

func RepoNameFromPath(p string) string

func ValidateRepo added in v0.0.3

func ValidateRepo(rootDir, repoPath, remote string) error

Types

type Config

type Config struct {
	Version int               `toml:"version" yaml:"version"`
	Repos   map[string]*Repo  `toml:"repos" yaml:"repos"`
	Groups  map[string]*Group `toml:"groups" yaml:"groups"`
}

func Load

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

func New

func New() *Config

func (*Config) AddGroup

func (c *Config) AddGroup(name string) error

func (*Config) AddRepo

func (c *Config) AddRepo(name, repoPath, remote, branch, desc string) error

func (*Config) AddRepoToGroup

func (c *Config) AddRepoToGroup(groupName, repoName string) error

func (*Config) DeleteGroup

func (c *Config) DeleteGroup(name string) error

func (*Config) RemoveRepo

func (c *Config) RemoveRepo(name string) (*Repo, error)

func (*Config) RemoveRepoFromGroup

func (c *Config) RemoveRepoFromGroup(groupName, repoName string) error

func (*Config) RepoNamesForGroup

func (c *Config) RepoNamesForGroup(groupName string) ([]string, error)

func (*Config) Save

func (c *Config) Save(path string) error

func (*Config) SortedGroupNames

func (c *Config) SortedGroupNames() []string

func (*Config) SortedRepoNames

func (c *Config) SortedRepoNames() []string

type Group

type Group struct {
	Repos []string `toml:"repos" yaml:"repos"`
}

type Repo

type Repo struct {
	Path        string `toml:"path" yaml:"path"`
	Remote      string `toml:"remote,omitempty" yaml:"remote,omitempty"`
	Branch      string `toml:"branch,omitempty" yaml:"branch,omitempty"`
	Description string `toml:"description,omitempty" yaml:"description,omitempty"`
}

Jump to

Keyboard shortcuts

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