Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine is a template engine based on template.Template with some additional functions. Don't create objects of this type directly, use the NewTemplate function instead.
type EngineBuilder ¶
type EngineBuilder struct {
// contains filtered or unexported fields
}
EngineBuilder contains the data and logic needed to create templates. Don't create objects of this type directly, use the NewTemplate function instead.
func NewEngine ¶
func NewEngine() *EngineBuilder
NewEngine creates a builder that can the be used to create a template engine.
func (*EngineBuilder) Build ¶
func (b *EngineBuilder) Build() (result *Engine, err error)
Build uses the configuration stored in the builder to create a new engine.
func (*EngineBuilder) SetDir ¶
func (b *EngineBuilder) SetDir(value string) *EngineBuilder
SetDir instructs the engine to load load the templates only from the given directory of the filesystem. This is optional and the default is to load all the templates.
func (*EngineBuilder) SetFS ¶
func (b *EngineBuilder) SetFS(value fs.FS) *EngineBuilder
SetFS sets the filesystem that will be used to read the templates. This is mandatory.
func (*EngineBuilder) SetLogger ¶
func (b *EngineBuilder) SetLogger(value logr.Logger) *EngineBuilder
SetLogger sets the logger that the engine will use to write messages to the log. This is mandatory.