repository

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: May 22, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoRepositories = errors.New("no skeleton repositories configured")

ErrNoRepositories is returned by NewMultiRepository if no repositories are configured.

Functions

func Create

func Create(path string) (kickoff.Repository, error)

Create creates a new repository at path and returns it. If path points to a remote repository or if path already exists, Create fails.

func LoadSkeletons

func LoadSkeletons(repo kickoff.Repository, names []string) ([]*kickoff.Skeleton, error)

LoadSkeletons loads multiple skeletons from given repository. Returns an error if loading of any of the skeletons fails.

func Open added in v0.2.0

func Open(ctx context.Context, url string, opts *Options) (kickoff.Repository, error)

Open opens a repository at url. Returns an error if url is not a valid local path or remote url.

func OpenMap added in v0.2.0

func OpenMap(ctx context.Context, repoURLMap map[string]string, opts *Options) (kickoff.Repository, error)

OpenMap opens multiple repositories and returns a kickoff.Repository which aggregates the repositores from the repoURLMap. The repoURLMap is a mapping of repository name to its url. Returns an error if repoURLMap contains empty keys or if creating individual repositories fails, or if repoURLMap is empty.

func OpenRef added in v0.2.0

func OpenRef(ctx context.Context, ref kickoff.RepoRef, opts *Options) (kickoff.Repository, error)

OpenRef opens a repository from a repository reference. Ref may reference a local or remote repository.

Types

type InvalidSkeletonRepositoryError added in v0.2.0

type InvalidSkeletonRepositoryError struct {
	RepoRef kickoff.RepoRef
}

func (InvalidSkeletonRepositoryError) Error added in v0.2.0

Error implements the error interface.

type Options added in v0.2.0

type Options struct {
	// Fetcher is used to fetch remote repositories. If nil a default git
	// fetcher will be used.
	Fetcher RemoteFetcher
}

Options for opening a repository.

type RemoteFetcher added in v0.2.0

type RemoteFetcher interface {
	// FetchRemote fetches the remote repository referenced by ref and places
	// it in the local path dictated by the ref and checks out the desired
	// revision (if configured).
	// Must return non-recoverable errors while fetching the repository or
	// checking out the desired revision.
	FetchRemote(ctx context.Context, ref kickoff.RepoRef) error
}

RemoteFetcher can fetch remote repositories.

func NewRemoteFetcher added in v0.2.0

func NewRemoteFetcher(client git.Client) RemoteFetcher

NewRemoteFetcher creates a RemoteFetcher which uses a git client to clone and fetch remote repositories.

type RevisionNotFoundError added in v0.2.0

type RevisionNotFoundError struct {
	RepoRef kickoff.RepoRef
}

func (RevisionNotFoundError) Error added in v0.2.0

func (e RevisionNotFoundError) Error() string

Error implements the error interface.

type SkeletonAlreadyExistsError added in v0.2.0

type SkeletonAlreadyExistsError struct {
	Name     string
	RepoName string
}

SkeletonAlreadyExistsError is the error returned if a skeleton already exists in a repository.

func (SkeletonAlreadyExistsError) Error added in v0.2.0

Error implements the error interface.

type SkeletonNotFoundError

type SkeletonNotFoundError struct {
	Name     string
	RepoName string
}

SkeletonNotFoundError is the error returned if a skeleton cannot be found in a repository.

func (SkeletonNotFoundError) Error

func (e SkeletonNotFoundError) Error() string

Error implements the error interface.

Jump to

Keyboard shortcuts

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