template

package
v0.1.112 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 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.Port

type Error

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

type Input

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

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 `` /* 175-byte string literal not displayed */

	Templates []Template `json:"templates,omitempty" required:"true" title:"Templates" minItems:"1" uniqueItems:"true" tab:"Templates"`
	Partials  []Template `` /* 164-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"`
	Content string `json:"content,omitempty" required:"true" title:"Template" format:"textarea"`
}

Jump to

Keyboard shortcuts

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