Documentation
¶
Index ¶
- Variables
- func Create(path string) (kickoff.Repository, error)
- func LoadSkeletons(repo kickoff.Repository, names []string) ([]*kickoff.Skeleton, error)
- func Open(ctx context.Context, url string, opts *Options) (kickoff.Repository, error)
- func OpenMap(ctx context.Context, repoURLMap map[string]string, opts *Options) (kickoff.Repository, error)
- func OpenRef(ctx context.Context, ref kickoff.RepoRef, opts *Options) (kickoff.Repository, error)
- type InvalidSkeletonRepositoryError
- type Options
- type RemoteFetcher
- type RevisionNotFoundError
- type SkeletonAlreadyExistsError
- type SkeletonNotFoundError
Constants ¶
This section is empty.
Variables ¶
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 ¶
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
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.
Types ¶
type InvalidSkeletonRepositoryError ¶ added in v0.2.0
func (InvalidSkeletonRepositoryError) Error ¶ added in v0.2.0
func (e InvalidSkeletonRepositoryError) Error() string
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
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
SkeletonAlreadyExistsError is the error returned if a skeleton already exists in a repository.
func (SkeletonAlreadyExistsError) Error ¶ added in v0.2.0
func (e SkeletonAlreadyExistsError) Error() string
Error implements the error interface.
type SkeletonNotFoundError ¶
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.