config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 24, 2026 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Mutate

func Mutate(fn func(*Config) error) error

func Path

func Path() (string, error)

func RemoveCatalog

func RemoveCatalog(name string) error

func ReorderCatalogs

func ReorderCatalogs(order []string) error

func Save

func Save(cfg Config) error

func UpsertCatalog

func UpsertCatalog(entry CatalogConfig) (added bool, err error)

Types

type CatalogConfig

type CatalogConfig struct {
	Name     string          `yaml:"name"`
	Type     CatalogType     `yaml:"type"`
	Git      *GitConfig      `yaml:"git,omitempty"`
	LocalDir *LocalDirConfig `yaml:"local-dir,omitempty"`
}

func (CatalogConfig) Location

func (r CatalogConfig) Location() string

func (CatalogConfig) Validate

func (r CatalogConfig) Validate() error

type CatalogType

type CatalogType string
const (
	CatalogTypeLocalDir CatalogType = "local-dir"
	CatalogTypeGit      CatalogType = "git"
)

type Config

type Config struct {
	Catalogs []CatalogConfig `yaml:"catalogs"`
	Auth     auth.Config     `yaml:"auth,omitempty"`
}

func Load

func Load() (Config, error)

func (Config) Catalog

func (c Config) Catalog(name string) (CatalogConfig, int, bool)

func (Config) Validate

func (c Config) Validate() error

type GitConfig

type GitConfig struct {
	Remote string `yaml:"remote"`
	Ref    string `yaml:"ref,omitempty"`
}

type LocalDirConfig

type LocalDirConfig struct {
	Path string `yaml:"path"`
}

Jump to

Keyboard shortcuts

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