Documentation
¶
Overview ¶
Package scaffolder is a general purpose file-system based scaffolding tool inspired by cookiecutter.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrSkip = errors.New("skip directory")
ErrSkip can be returned by WalkDir callbacks to skip a file or directory.
Functions ¶
Types ¶
type AfterEachExtensionFunc ¶ added in v0.7.0
AfterEachExtensionFunc is a convenience type for creating an Extension.AfterEach from a function.
func (AfterEachExtensionFunc) AfterEach ¶ added in v0.7.0
func (f AfterEachExtensionFunc) AfterEach(path string) error
func (AfterEachExtensionFunc) Extend ¶ added in v0.7.0
func (f AfterEachExtensionFunc) Extend(mutableConfig *Config) error
type Config ¶ added in v0.6.0
type Config struct { Context any Funcs FuncMap Exclude []string // contains filtered or unexported fields }
Config for the scaffolding.
type ExtensionFunc ¶ added in v0.6.0
ExtensionFunc is a convenience type for creating an Extension.Extend from a function.
func (ExtensionFunc) AfterEach ¶ added in v0.6.0
func (f ExtensionFunc) AfterEach(path string) error
func (ExtensionFunc) Extend ¶ added in v0.6.0
func (f ExtensionFunc) Extend(mutableConfig *Config) error
type FuncMap ¶ added in v0.6.0
FuncMap is a map of functions to use in scaffolding templates.
The key is the function name and the value is a function taking a single argument and returning either `string` or `(string, error)`.
type Option ¶
type Option func(*scaffoldOptions)
Option is a function that modifies the behaviour of the scaffolder.
func AfterEach ¶ added in v0.6.0
AfterEach configures Scaffolder to call "after" for each file or directory created.
Useful for setting file permissions, etc.
Each AfterEach function is called in order.
func Exclude ¶ added in v0.3.0
Exclude the given regex paths from scaffolding.
Matching occurs before template evaluation and .tmpl suffix removal.