codebase

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2021 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrCodebaseAlreadyExist is returned when a codebase already exist in current directory
	ErrCodebaseAlreadyExist = errors.New("a codebase already exist")
	// ErrCodebaseNotExist is returned when no codebase is found in current or parent directories
	ErrCodebaseNotExist = errors.New("no codebase found in current or parent directories")

	// DefaultProvider is the default codebase provider
	DefaultProvider = &provider{
		repoProvider:     repository.DefaultProvider,
		manifestProvider: &manifest.JSONProvider{},
	}
)
View Source
var (
	// ErrPathTaken is returned when a project already exist at given path
	ErrPathTaken = errors.New("a project already exist at given path")
)

Functions

This section is empty.

Types

type Codebase

type Codebase interface {
	Projects() (map[string]ProjectEntry, error)
	Manifest() (manifest.Manifest, error)
	Add(remote, path string, config map[string]string) (manifest.Project, error)
	Sync(delete bool, addedChan chan<- ProjectEntry, deletedChan chan<- ProjectEntry) error
	LocalPath() string
	Run(scriptName string, args []string, writer io.Writer) error
	BulkGIT(args []string, writer io.Writer) error
	SetScript(name string, script []string, global bool) error
	MoveProject(oldPath, newPath string) error
	RmProject(path string, delete bool) error
	SetHook(scriptName string) error
}

Codebase is a collection of projects

type ProjectEntry added in v0.2.0

type ProjectEntry struct {
	Path       string
	Project    manifest.Project
	Repository repository.Repository
}

ProjectEntry map a codebase project entry (i.e the project alongside his codebase local path) and optionally the linked Git repository

type Provider

type Provider interface {
	Init(path, remote string, importRepositories bool) (Codebase, error)
	Open(path string) (Codebase, error)
	Clone(url, path string, ch chan<- ProjectEntry) (Codebase, error)
}

Provider is something that allows to Init, Open, or Clone a Codebase

Jump to

Keyboard shortcuts

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