Mustache templating
This function requires a Mustache template and data. The function returns the rendered template with the data provided. It runs Mustache version 1.1.1.
functions:
- id: mustache
image: gcr.io/direktiv/functions/mustache:1.0
type: knative-workflow
- id: mustache
type: action
action:
function: mustache
input:
files:
- name: template.tmpl
data: <h1>{{header}}</h1>
template: template.tmpl
data:
header: This is the header
- id: mustache
type: action
action:
function: mustache
files:
- key: templ.tpl
scope: workflow
input:
template: templ.tpl
data:
header: This is the header
No secrets required
List of executed commands.
[
{
"result": "\u003ch1\u003eTHIS IS THE HEADER\u003c/h1\u003e",
"success": true
},
{
"result": "My Template Output",
"success": true
}
]
| Type | Description |
|---|---|
| io.direktiv.command.error | Command execution failed |
| io.direktiv.output.error | Template error for output generation of the service |
| io.direktiv.ri.error | Can not create information object from request |
Properties
| Name | Type | Go type | Required | Default | Description | Example |
|---|---|---|---|---|---|---|
| mustache | PostOKBodyMustache | PostOKBodyMustache |
Properties
| Name | Type | Go type | Required | Default | Description | Example |
|---|---|---|---|---|---|---|
| result | string | string | ✓ | Template output | ||
| success | boolean | bool | ✓ |
Properties
| Name | Type | Go type | Required | Default | Description | Example |
|---|---|---|---|---|---|---|
| data | interface{} | interface{} | ||||
| files | []DirektivFile | []apps.DirektivFile | File to create before running commands. | |||
| template | string | string | Mustache template to use |
Content type
Image
Digest
sha256:d65a14a00…
Size
16 MB
Last updated
almost 4 years ago
docker pull westwind027/mustache