catalog

package
v0.0.0-...-e7d2f50 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultRepository is the default recipes repository short name.
	DefaultRepository = "mkdeb/core"
)

Variables

View Source
var (
	ErrAlreadyUpToDate    = errors.New("already up-to-date")
	ErrRecipeNotFound     = errors.New("recipe not found")
	ErrRepositoryExist    = errors.New("repository already exists")
	ErrRepositoryNotExist = errors.New("repository does not exist")
)

Errors:

Functions

func Ready

func Ready(path string) bool

Ready returns whether or not the catalog is ready for use.

Types

type Catalog

type Catalog struct {
	Path string
	// contains filtered or unexported fields
}

Catalog is a recipes catalog.

func New

func New(path string) (*Catalog, error)

New creates a new recipes catalog instance.

func (*Catalog) Close

func (c *Catalog) Close() error

Close closes the catalog index.

func (*Catalog) Index

func (c *Catalog) Index() (uint64, error)

Index indexes repositories recipes into the catalog.

func (*Catalog) InstallRepository

func (c *Catalog) InstallRepository(name, url, branch string, force bool) (uint64, error)

InstallRepository installs a new recipes repository into the catalog.

func (*Catalog) Recipe

func (c *Catalog) Recipe(name string) (*recipe.Recipe, error)

Recipe searches the catalog for a recipe.

func (*Catalog) Repositories

func (c *Catalog) Repositories() ([]*Repository, error)

Repositories returns a list of installed recipes repositories.

func (*Catalog) Search

func (c *Catalog) Search(term string, includeDesc bool) ([]*SearchHit, error)

Search searches the catalog index for recipes matches.

func (*Catalog) UninstallRepository

func (c *Catalog) UninstallRepository(name string) (uint64, error)

UninstallRepository uninstalls a recipes repository from the catalog.

func (*Catalog) Walk

func (c *Catalog) Walk(f func(rcp *recipe.Recipe, repo *Repository, err error) error) error

Walk walks the catalog calling a function for each recipe found.

type Repository

type Repository struct {
	Name   string
	URL    string
	Branch string
	Path   string
}

Repository is a recipes repository.

func NewRepository

func NewRepository(path, name, url, branch string) *Repository

NewRepository creates a new recipes repository instance.

func NewRepositoryFromPath

func NewRepositoryFromPath(path string) (*Repository, error)

NewRepositoryFromPath creates a new recipes repository instance from an existing path.

func (*Repository) Recipe

func (r *Repository) Recipe(name string) (*recipe.Recipe, error)

Recipe loads a recipe from the repository.

func (*Repository) Update

func (r *Repository) Update(force bool) error

Update updates the repository from the remote.

func (*Repository) Walk

func (r *Repository) Walk(f func(recipe *recipe.Recipe, err error) error) error

Walk walks the repository calling a function for each recipe found.

type SearchHit

type SearchHit struct {
	Name        string
	Description string
	Repository  string
}

SearchHit is a catalog recipe search hit.

Jump to

Keyboard shortcuts

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