repo

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: May 29, 2018 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const PackDirName = "packs"

PackDirName is name for the packs directory

Variables

View Source
var (
	// ErrExists indicates that the pack repo already exists
	ErrExists = errors.New("pack repo already exists")
	// ErrDoesNotExist indicates that the pack repo does not exist
	ErrDoesNotExist = errors.New("pack repo does not exist")
	// ErrHomeMissing indicates that the packs dir is missing.
	ErrHomeMissing = errors.New(`pack repo home "$(draft home)/packs" does not exist`)
	// ErrMissingSource indicates that information about the source of the pack repo was not found
	ErrMissingSource = errors.New("cannot get information about pack repo source")
	// ErrRepoDirty indicates that the pack repo was modified
	ErrRepoDirty = errors.New("pack repo was modified")
	//ErrVersionDoesNotExist indicates that the requested pack repo version does not exist
	ErrVersionDoesNotExist = errors.New("requested version does not exist")
)
View Source
var ErrPackNotFoundInRepo = errors.New("pack not found in pack repo")

ErrPackNotFoundInRepo is the error returned when a pack is not found in a pack repo

Functions

This section is empty.

Types

type Builtin

type Builtin struct {
	Name    string
	URL     string
	Version string
}

Builtin contains metadata to the built-in packs. Used to install/uninstall a pack.

func Builtins

func Builtins() []*Builtin

Builtins fetches all built-in pack repositories as a map of url=>ver.

type Repository

type Repository struct {
	Name string
	Dir  string
}

Repository represents a pack repository.

func FindRepositories

func FindRepositories(path string) []Repository

FindRepositories takes a given path and returns a list of repositories.

Repositories are defined as directories with a "packs" directory present.

func (*Repository) List added in v0.14.0

func (r *Repository) List() ([]string, error)

List returns a slice of pack names in the repository or error.

The returned pack names are prefixed by the repository name, e.g. "draft/go"

func (*Repository) Pack added in v0.14.0

func (r *Repository) Pack(name string) (string, error)

Pack finds a packs with the given name in a repository and returns path

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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