texttemplate

package
v0.39.0 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EvaluationCtxDialectName template.EvaluationCtxDialectName = "text"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type EvaluationCtx

type EvaluationCtx struct{}

func (EvaluationCtx) PrepareNode

func (e EvaluationCtx) PrepareNode(
	parentNode template.EvaluationNode, node template.EvaluationNode) error

func (EvaluationCtx) Replace

func (e EvaluationCtx) Replace(
	parentNodes []template.EvaluationNode, val interface{}) error

func (EvaluationCtx) SetMapItemKey added in v0.17.0

func (e EvaluationCtx) SetMapItemKey(node template.EvaluationNode, val interface{}) error

func (EvaluationCtx) ShouldWrapRootValue

func (e EvaluationCtx) ShouldWrapRootValue(nodeVal interface{}) bool

func (EvaluationCtx) WrapRootValue

func (e EvaluationCtx) WrapRootValue(val interface{}) interface{}

type NodeCode

type NodeCode struct {
	Position *filepos.Position
	Content  string
	// contains filtered or unexported fields
}

type NodeCodeMeta

type NodeCodeMeta struct {
	*NodeCode
}

func (NodeCodeMeta) Code

func (p NodeCodeMeta) Code() string

func (NodeCodeMeta) ShoudTrimSpaceLeft

func (p NodeCodeMeta) ShoudTrimSpaceLeft() bool

func (NodeCodeMeta) ShouldPrint

func (p NodeCodeMeta) ShouldPrint() bool

func (NodeCodeMeta) ShouldTrimSpaceRight

func (p NodeCodeMeta) ShouldTrimSpaceRight() bool

type NodeRoot

type NodeRoot struct {
	Items []interface{}
	// contains filtered or unexported fields
}

func (*NodeRoot) AddValue

func (n *NodeRoot) AddValue(val interface{}) error

func (*NodeRoot) AsString

func (n *NodeRoot) AsString() string

func (*NodeRoot) DeepCopyAsInterface

func (n *NodeRoot) DeepCopyAsInterface() interface{}

func (*NodeRoot) GetAnnotations

func (n *NodeRoot) GetAnnotations() interface{}

func (*NodeRoot) GetValues

func (n *NodeRoot) GetValues() []interface{}

func (*NodeRoot) ResetValue

func (n *NodeRoot) ResetValue()

func (*NodeRoot) SetAnnotations

func (n *NodeRoot) SetAnnotations(anns interface{})

func (*NodeRoot) SetValue

func (n *NodeRoot) SetValue(val interface{}) error

type NodeText

type NodeText struct {
	Position *filepos.Position
	Content  string
	// contains filtered or unexported fields
}

func (*NodeText) AddValue

func (n *NodeText) AddValue(val interface{}) error

func (*NodeText) DeepCopyAsInterface

func (n *NodeText) DeepCopyAsInterface() interface{}

func (*NodeText) GetAnnotations

func (n *NodeText) GetAnnotations() interface{}

func (*NodeText) GetValues

func (n *NodeText) GetValues() []interface{}

func (*NodeText) ResetValue

func (n *NodeText) ResetValue()

func (*NodeText) SetAnnotations

func (n *NodeText) SetAnnotations(anns interface{})

func (*NodeText) SetValue

func (n *NodeText) SetValue(val interface{}) error

type Parser

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

func NewParser

func NewParser() *Parser

func (*Parser) Parse

func (p *Parser) Parse(dataBs []byte, associatedName string) (*NodeRoot, error)

func (*Parser) ParseWithPosition added in v0.17.0

func (p *Parser) ParseWithPosition(dataBs []byte, associatedName string, startPos *filepos.Position) (*NodeRoot, error)

type Template

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

func NewTemplate

func NewTemplate(name string) *Template

func (*Template) Compile

func (e *Template) Compile(rootNode *NodeRoot) (*template.CompiledTemplate, error)

func (*Template) CompileInline

func (e *Template) CompileInline(rootNode *NodeRoot,
	instructions *template.InstructionSet, nodes *template.Nodes) ([]template.Line, error)

Jump to

Keyboard shortcuts

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