Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Compiler ¶ added in v0.3.0
type Compiler struct {
Template string
Expressions []Expression
}
func Compile ¶ added in v0.0.10
func Compile(template string, expressions ...Expression) Compiler
Compile takes a template with placeholders into which expressions can be compiled. Escape '?' by using '??'.
type Error ¶ added in v0.0.2
type Error struct {
Err error
}
Error wraps any error in this package and can be used to create an Expression.
type Expression ¶
func If ¶
func If(condition bool, then Expression) Expression
func IfElse ¶ added in v0.0.4
func IfElse(condition bool, then, els Expression) Expression
type ExpressionError ¶ added in v0.0.11
type ExpressionError struct {
Position int
}
ExpressionError is returned by the Compile Expression, if an expression is nil.
func (ExpressionError) Error ¶ added in v0.0.11
func (e ExpressionError) Error() string
type Joiner ¶ added in v0.3.0
type Joiner struct {
Sep string
Expressions []Expression
}
func Append ¶
func Append(expressions ...Expression) Joiner
func Join ¶
func Join(sep string, expressions ...Expression) Joiner
type NumberOfArgumentsError ¶ added in v0.0.11
NumberOfArgumentsError is returned if arguments doesn't match the number of placeholders.
func (NumberOfArgumentsError) Error ¶ added in v0.0.11
func (e NumberOfArgumentsError) Error() string
Click to show internal directories.
Click to hide internal directories.