Documentation
¶
Overview ¶
Package source fetches a blueprint's template skeleton into a local directory that the renderer can walk.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseSpec ¶
ParseSpec turns what a user typed on the command line into a source.
The accepted forms, in the order they are tried:
./templates/go-api a local directory /abs/path/to/template a local directory owner/repo GitHub, default branch owner/repo@v1.2.0 GitHub at a branch, tag or commit https://github.com/owner/repo https://example.com/t.zip a zip archive https://example.com/t.git any git remote git@github.com:owner/repo.git
The shorthand is worth the parsing: `rig new api -b JustSteveKing/go-api` is what people will actually type, and making them write a full URL for the common case is the kind of friction that stops a tool being reached for.
Types ¶
type Template ¶
type Template struct {
// Root is the directory to render from, already narrowed to any subdir.
Root string
// Ref identifies exactly what was fetched: a commit SHA for git sources,
// a "sha256:..." digest for archives, empty for a local directory. It goes
// into the lockfile, and it is what makes `rig apply` able to tell whether
// the template moved.
Ref string
// Origin describes where the template came from, as declared rather than
// as resolved on disk.
//
// It must never be a local staging path. A blueprint fetched from git is
// unpacked into a temp directory, so recording the resolved path would put
// a directory name that no longer exists into the lockfile — and a
// different one on every run, making the lockfile churn on every apply.
Origin string
// contains filtered or unexported fields
}
Template is a fetched skeleton on local disk.
Click to show internal directories.
Click to hide internal directories.