Documentation
¶
Overview ¶
Package template contains the template node implementation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TemplateConfig ¶
TemplateConfig holds configuration for the template node. Format is "json" (default — rendered output is parsed into msg.Payload) or "text" (rendered output becomes msg.Payload as a string).
type TemplateNode ¶
TemplateNode renders a Go text/template against msg.Payload, the equivalent of Node-RED's template node
func NewTemplateNode ¶
func NewTemplateNode(node nodestore.NodeInterface, config *TemplateConfig) *TemplateNode
NewTemplateNode creates a new template node
func (*TemplateNode) Execute ¶
func (n *TemplateNode) Execute(ctx context.Context, input nodestore.MessageInterface) (nodestore.MessageInterface, error)
Execute renders the configured template with msg.Payload as the dot context and stores the result back into msg.Payload