2019-03-13 04:14:30 -07:00
|
|
|
package main
|
|
|
|
|
|
|
|
type text struct {
|
|
|
|
props *properties
|
|
|
|
env environmentInfo
|
|
|
|
}
|
|
|
|
|
|
|
|
const (
|
2020-11-12 00:43:32 -08:00
|
|
|
// TextProperty represents text to write
|
2019-03-13 04:14:30 -07:00
|
|
|
TextProperty Property = "text"
|
|
|
|
)
|
|
|
|
|
|
|
|
func (t *text) enabled() bool {
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
|
|
|
|
func (t *text) string() string {
|
|
|
|
textProperty := t.props.getString(TextProperty, "!!text property not defined!!")
|
2021-08-09 20:48:44 -07:00
|
|
|
template := &textTemplate{
|
|
|
|
Template: textProperty,
|
|
|
|
Context: t,
|
|
|
|
Env: t.env,
|
|
|
|
}
|
|
|
|
textOutput := template.renderPlainContextTemplate(nil)
|
|
|
|
return textOutput
|
2019-03-13 04:14:30 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
func (t *text) init(props *properties, env environmentInfo) {
|
|
|
|
t.props = props
|
|
|
|
t.env = env
|
|
|
|
}
|