template

package
v0.17.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 7, 2026 License: Apache-2.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package template provides a reusable Go text-template renderer and exposes it to Flow as the template.render action.

Typical use:

template.render @{ template: "Hello {{.name}}", variables: { name: "Flow" } }

Index

Constants

View Source
const ID = "template"

Variables

View Source
var RenderAction = action.New("template.render", func(_ context.Context, req RenderRequest) (string, error) {
	result, err := flowtemplate.Render(req.Template, req.Variables)
	if err != nil {
		return "", xerr.BadRequest(err.Error())
	}
	return result, nil
}).Description("Render a text template with supplied variables").
	Example(RenderRequest{
		Template:  "Hello {{.name}}",
		Variables: map[string]any{"name": "Flow"},
	}).Build()

RenderAction exposes the package-agnostic renderer to Flow workflows.

Functions

func Bundle

func Bundle(_ map[string]string) core.Bundle

Bundle exposes the template.render action to Flow.

func Library

func Library() action.Library

Library returns the action library without requiring registry lookup.

Types

type RenderRequest

type RenderRequest struct {
	Template  string         `json:"template" cli:"template"`
	Variables map[string]any `json:"variables" cli:"variables"`
}

RenderRequest is the input shape for the template.render Flow action.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL