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 ¶
func About ¶ added in v1.5.0
func About() string
About returns text describing how scaffolder works.
Types ¶
type AfterEachExtensionFunc ¶
AfterEachExtensionFunc is a convenience type for creating an Extension.AfterEach from a function.
func (AfterEachExtensionFunc) AfterEach ¶
func (f AfterEachExtensionFunc) AfterEach(path string) error
func (AfterEachExtensionFunc) Extend ¶
func (f AfterEachExtensionFunc) Extend(mutableConfig *Config) error
type Config ¶
type Config struct {
Context any
Funcs FuncMap
Exclude []string
// contains filtered or unexported fields
}
Config for the scaffolding.
type ExtensionFunc ¶
ExtensionFunc is a convenience type for creating an Extension.Extend from a function.
func (ExtensionFunc) AfterEach ¶
func (f ExtensionFunc) AfterEach(path string) error
func (ExtensionFunc) Extend ¶
func (f ExtensionFunc) Extend(mutableConfig *Config) error
type FuncMap ¶
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 ¶
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 ¶
Exclude the given regex paths from scaffolding.
Matching occurs before template evaluation and .tmpl suffix removal.