package
1.2.9
Repository: https://github.com/core-go/core.git
Documentation: pkg.go.dev

# Functions

HTMLEscape writes to w the escaped HTML equivalent of the plain text data b.
HTMLEscaper returns the escaped HTML equivalent of the textual representation of its arguments.
HTMLEscapeString returns the escaped HTML equivalent of the plain text data s.
IsEmptyTree reports whether this tree (node) is empty of everything but space.
IsTrue reports whether the value is 'true', in the sense of not the zero of its type, and whether the value has a meaningful truth value.
JSEscape writes to w the escaped JavaScript equivalent of the plain text data b.
JSEscaper returns the escaped JavaScript equivalent of the textual representation of its arguments.
JSEscapeString returns the escaped JavaScript equivalent of the plain text data s.
Must is a helper that wraps a call to a function returning (*Template, error) and panics if the error is non-nil.
New allocates a new, undefined template with the given name.
NewIdentifier returns a new IdentifierNode with the given identifier name.
New allocates a new parse tree with the given name.
Parse returns a map from template name to parse.Tree, created by parsing the templates described in the argument string.
ParseFiles creates a new Template and parses the template definitions from the named files.
ParseGlob creates a new Template and parses the template definitions from the files identified by the pattern.
Sort accepts a map and returns a SortedMap that has the same keys and values but in a stable sorted order according to the keys, modulo issues raised by unorderable key values such as NaNs.
URLQueryEscaper returns the escaped value of the textual representation of its arguments in a form suitable for embedding in a URL query.

# Constants

A non-control action such as a field evaluation.
A boolean constant.
A sequence of field accesses.
An element of a pipeline.
The cursor, dot.
A field or method name.
An identifier; always a function name.
An if action.
A list of Nodes.
An untyped nil constant.
A numerical constant.
A pipeline of commands.
A range action.
A string constant.
A template invocation action.
Plain text.
A $ variable.
A with action.

# Structs

ActionNode holds an action (something bounded by delimiters).
BoolNode holds a boolean constant.
BranchNode is the common representation of if, range, and with.
ChainNode holds a term followed by a chain of field accesses (identifier starting with '.').
CommandNode holds a command (a pipeline inside an evaluating action).
DotNode holds the special identifier '.'.
ExecError is the custom error type returned when Execute has an error evaluating its template.
FieldNode holds a field (identifier starting with '.').
IdentifierNode holds an identifier.
IfNode represents an {{if}} action and its commands.
ListNode holds a sequence of nodes.
NilNode holds the special identifier 'nil' representing an untyped nil constant.
NumberNode holds a number: signed or unsigned integer, float, or complex.
PipeNode holds a pipeline with optional declaration.
RangeNode represents a {{range}} action and its commands.
SortedMap represents a map's keys and values.
StringNode holds a string constant.
Template is the representation of a parsed template.
TemplateNode represents a {{template}} action.
TextNode holds plain text.
Tree is the representation of a single parsed template.
AssignNode holds a list of variable names, possibly with chained field accesses.
WithNode represents a {{with}} action and its commands.

# Interfaces

A Node is an element in the parse tree.

# Type aliases

FuncMap is the type of the map defining the mapping from names to functions.
NodeType identifies the type of a parse tree node.
Pos represents a byte position in the original input text from which this template was parsed.