Documentation ¶
Index ¶
- func Apply(root string, params map[string]string, options ...ApplyOption) error
- type ApplyOption
- func WithDelims(left, right string) ApplyOption
- func WithExclusions(exclusions []string) ApplyOption
- func WithInput(r io.Reader) ApplyOption
- func WithLanguage(language language.Tag) ApplyOption
- func WithLogger(log *log.Logger, verbose bool) ApplyOption
- func WithOutput(w io.Writer, isTTY bool) ApplyOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ApplyOption ¶
ApplyOption applies options to the processor.
func WithDelims ¶ added in v0.5.0
func WithDelims(left, right string) ApplyOption
WithDelims specifies alternate delimiters to open and close template expressions. The defaults are "{{" and "}}". Both or neither must be non-empty or this function panics.
func WithExclusions ¶ added in v0.2.0
func WithExclusions(exclusions []string) ApplyOption
WithExclusions specifies excluded directories and files. These paths should be relative to the root directory passed to Apply. The prefixes "./" and "/" are automatically removed. Comparisons are case-insensitive.
func WithInput ¶
func WithInput(r io.Reader) ApplyOption
WithInput specifies the input Reader. By default this is os.Stdin.
func WithLanguage ¶
func WithLanguage(language language.Tag) ApplyOption
WithLanguage specifies the language for any template function that needs it. The default is language.English.
func WithLogger ¶
func WithLogger(log *log.Logger, verbose bool) ApplyOption
WithLogger specifies the logger to write to and whether to log verbose output. No logging is performed by default.
func WithOutput ¶
func WithOutput(w io.Writer, isTTY bool) ApplyOption
WithOutput specifies the output Writer and whether it represents a TTY. By default this is os.Stderr. isTTY depends on whether os.Stderr is redirected.