template

package
v0.1.63 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EngineComponent    = "template-engine"
	EngineInPort       = "input"
	EngineSettingsPort = "settings"
	EngineOutPort      = "output"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context any

type Engine

type Engine struct {
	// contains filtered or unexported fields
}

func (*Engine) GetInfo

func (h *Engine) GetInfo() module.ComponentInfo

func (*Engine) Handle

func (h *Engine) Handle(ctx context.Context, handler module.Handler, port string, msg interface{}) error

func (*Engine) Instance

func (h *Engine) Instance() module.Component

func (*Engine) Ports

func (h *Engine) Ports() []module.NodePort

type Input

type Input struct {
	Context       Context       `` /* 159-byte string literal not displayed */
	RenderContext RenderContext `` /* 150-byte string literal not displayed */
	Template      string        `json:"template" required:"true" title:"Template" description:"Template to render" propertyOrder:"3"`
}

type Output

type Output struct {
	Context       Context       `json:"context"`
	RenderContext RenderContext `json:"renderContext"`
	Content       string        `json:"content"`
}

type RenderContext

type RenderContext any

type Settings

type Settings struct {
	Templates []Template `json:"templates,omitempty" required:"true" title:"Templates" minItems:"1" uniqueItems:"true" propertyOrder:"1"`
	Partials  []Template `` /* 167-byte string literal not displayed */
}

type Template

type Template struct {
	Name    string `json:"name" required:"true" title:"File name" Description:"e.g. footer.tmpl" propertyOrder:"1"`
	Content string `json:"content" required:"true" title:"Template" format:"textarea" propertyOrder:"2"`
}

Jump to

Keyboard shortcuts

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