TemplateEngine
Service responsible for templates.
On this page
TemplateEngine of type template.Engine
This service is responsible for string templating. It allows to inject previously cached/generated data into step’s arguments.
// Engine is entity that has ability to work with templates.
type Engine interface {
// Replace replaces template values using provided storage.
Replace(templateValue string, storage map[string]interface{}) (string, error)
}
To replace it with your own implementation use following setter:
func (apiCtx *APIContext) SetTemplateEngine(t template.Engine)
Some examples of custom template engine may be:
- one which uses different syntax for injecting variables
- one which logs somewhere injected values