Documentation
¶
Index ¶
- Variables
- func Create(path, skeletonName string) error
- func DisableCache()
- func EnableCache()
- func LoadSkeleton(ctx context.Context, repo kickoff.Repository, name string) (*kickoff.Skeleton, error)
- func LoadSkeletons(ctx context.Context, repo kickoff.Repository, names []string) ([]*kickoff.Skeleton, error)
- func New(url string) (kickoff.Repository, error)
- func NewFromMap(repoURLMap map[string]string) (kickoff.Repository, error)
- func NewFromRef(ref kickoff.RepoRef) (kickoff.Repository, error)
- func NewNamed(name, url string) (kickoff.Repository, error)
- type DependencyCycleError
- type SkeletonNotFoundError
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNoRepositories is returned by NewMultiRepository if no repositories are // configured. ErrNoRepositories = errors.New("no skeleton repositories configured") // ErrNotARemoteRepository is returned by NewRemoteRepository if the provided // info does not describe a remote repository. ErrNotARemoteRepository = errors.New("not a remote repository") )
Functions ¶
func Create ¶
Create creates a new skeleton repository at path and initializes it with a skeleton located in a subdir named skeletonName.
func EnableCache ¶
func EnableCache()
EnableCache enables the repository cache. An enabled cache will cause New and NewNamed to return the same Repository instance for consecutive calls with pairs of the same name and url. This can speed up operations on remote skeleton repositories as it reduce the number of git operations that need to be carried out. The speedup may be noticeable when working with skeletons that have parents.
func LoadSkeleton ¶
func LoadSkeleton(ctx context.Context, repo kickoff.Repository, name string) (*kickoff.Skeleton, error)
LoadSkeleton loads the skeleton with name from given repository. The passed in context is propagated to all operations that cross API boundaries (e.g. git operations) and can be used to enforce timeouts or cancel them. Returns an error if loading the skeleton fails.
func LoadSkeletons ¶
func LoadSkeletons(ctx context.Context, repo kickoff.Repository, names []string) ([]*kickoff.Skeleton, error)
LoadSkeletons loads multiple skeletons from given repository. The passed in context is propagated to all operations that cross API boundaries (e.g. git operations) and can be used to enforce timeouts or cancel them. Returns an error if loading of any of the skeletons fails.
func New ¶
func New(url string) (kickoff.Repository, error)
New creates a new kickoff Repository for url. Returns an error if url is not a valid local path or remote url.
func NewFromMap ¶ added in v0.1.1
func NewFromMap(repoURLMap map[string]string) (kickoff.Repository, error)
NewFromMap creates 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 NewFromRef ¶ added in v0.1.1
func NewFromRef(ref kickoff.RepoRef) (kickoff.Repository, error)
NewFromRef creates a new kickoff.Repository from a repository reference. Ref may reference a local or remote repository.
Types ¶
type DependencyCycleError ¶
DependencyCycleError is the error returned while loading a skeleton's parent if a dependency cycle is detected.
func (DependencyCycleError) Error ¶
func (e DependencyCycleError) Error() string
Error implements error.
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 error.