Documentation ¶
Index ¶
- func BaseTemplate() *template.Template
- func CloneRepo(ctx context.Context, repo string) (path string, err error)
- func CompileExcludes(t *template.Template, excludes []Exclude, data *Data) ([]string, error)
- func GetInput(key string, data map[string]any) (input any, err error)
- func IsEmptyDir(name string) (bool, error)
- func IsUpstreamRepo(path string) bool
- func LookupValue(key string, data map[string]any) (value any, exists bool)
- func MakeFsWalker(t *template.Template, data *Data, outPath string, ...) fs.WalkDirFunc
- func MergeMaps(maps ...map[string]any) map[string]any
- func NewFileMatcher(paths []string) (*fileMatcher, error)
- func PathExists(path string) (bool, error)
- func ReadFile(path string, dist any) error
- func ReadURL(url string, dist any) error
- func ReadValues(urlOrPath string, dist any) error
- func RenderString(t *template.Template, s string, data *Data) (string, error)
- func RunHook(ctx context.Context, t *template.Template, chdir string, hook Hook, data *Data) error
- type BlueprintMeta
- type Data
- type Exclude
- type Hook
- type Matcher
- type Project
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BaseTemplate ¶
create a new template with extra functions
func CloneRepo ¶
clone a git repo to the /tmp/<repo>, striping the .git suffix this has dependencies on the git binary
func CompileExcludes ¶
check for each item in the exclude list if they should be included in the resulting string slice and append them to the slice if they do
func IsEmptyDir ¶
func LookupValue ¶
lookup nested values in a map by flat key path. i.e. foo.bar.baz if the map contains a dot, it must be escaped with a backslash
func MakeFsWalker ¶
func MakeFsWalker(t *template.Template, data *Data, outPath string, excludeMatcher, rawMatcher Matcher, helpersFileName string) fs.WalkDirFunc
makeWalker returns a filepath.WalkFunc that renders all template found in the file tree with the given data and writes them to the output directory
func NewFileMatcher ¶
func PathExists ¶
func ReadValues ¶
read the values from url or file into dist
func RenderString ¶
use the given template to parse and render the given string since this called template.Parse, the given string is associated with the template named templates are left intact