template

package
v0.1.84 Latest Latest
Warning

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

Go to latest
Published: May 31, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EngineComponent    = "template-engine"
	EngineRequestPort  = "request"
	EngineResponsePort = "response"
	EngineErrorPort    = "error"
)

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 Error added in v0.1.66

type Error struct {
	Input Input  `json:"input"`
	Error string `json:"error"`
}

type Input

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

type Output

type Output struct {
	Input   Input  `json:"input"`
	Content string `json:"content"`
}

type RenderContext

type RenderContext any

type Settings

type Settings struct {
	EnableErrorPort bool `` /* 193-byte string literal not displayed */

	Templates []Template `` /* 126-byte string literal not displayed */
	Partials  []Template `` /* 182-byte string literal not displayed */
}

type Template

type Template struct {
	Name    string `json:"name,omitempty" required:"true" title:"File name" Description:"e.g. footer.tmpl" propertyOrder:"1"`
	Content string `json:"content,omitempty" 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