template

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventArgPrefix     = "$."
	EventDataArgPrefix = EventArgPrefix + "data"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Node

type Node interface {
	Type() NodeType
	Name() string
	Value(ctx *context.EventContext) (interface{}, bool)
}

type NodeType

type NodeType int
const (
	Constant             NodeType = iota // Plain text.
	Define                               // A <var> variable, example "key":<var>
	DefineString                         // A <var> variable, example "key":"<var>" or "key":"other <var>"
	EventAttribute                       // A $.attributeName, example "key": $.id
	EventAttributeString                 // A $.attributeName, example "key": "$.id" or "key":"other $.id"
	EventData                            // A $.data.path, example "key": $.data.key
	EventDataString                      // A $.data.path, example "key": "$.data.key" or "key":"other $.data.key"
)

func (NodeType) Type

func (t NodeType) Type() NodeType

type Template

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

func NewTemplate

func NewTemplate() *Template

func (*Template) ContentType

func (t *Template) ContentType() string

func (*Template) Execute

func (t *Template) Execute(ceCtx *context.EventContext) []byte

func (*Template) Exist

func (t *Template) Exist() bool

func (*Template) Parse

func (t *Template) Parse(text string)

Jump to

Keyboard shortcuts

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