Documentation ¶
Index ¶
- Constants
- func DoChildNodes(childNodes []Node, env map[string]interface{}) ([]byte, error)
- func FindAllExpressConvertString(str string) []string
- func FindAllExpressString(str string) []string
- func Replace(startChar string, findStrs []string, data string, ...) (string, error)
- type ExpressionEngine
- type Node
- type NodeBind
- type NodeChoose
- type NodeConfigHolder
- type NodeForEach
- type NodeIf
- type NodeInclude
- type NodeOtherwise
- type NodeParser
- type NodeString
- type NodeTrim
- type NodeType
- type NodeWhen
- type SqlArgTypeConvert
Constants ¶
View Source
const DefaultOverrides = ","
View Source
const DefaultWhereElement_Prefix = "where"
View Source
const DefaultWhereElement_PrefixOverrides = "and |or |And |Or |AND |OR "
Variables ¶
This section is empty.
Functions ¶
func DoChildNodes ¶
执行子所有节点
func FindAllExpressConvertString ¶
find like #{*} value *
func Replace ¶
func Replace(startChar string, findStrs []string, data string, typeConvert SqlArgTypeConvert, arg map[string]interface{}, engine ExpressionEngine) (string, error)
执行替换操作
Types ¶
type ExpressionEngine ¶
type ExpressionEngine interface { //引擎名称 Name() string //编译一个表达式 //参数:lexerArg 表达式内容 //返回:interface{} 编译结果,error 错误 Lexer(lexerArg string) (interface{}, error) //执行一个表达式 //参数:lexerResult=编译结果,arg=参数 //返回:执行结果,错误 Eval(lexerResult interface{}, arg interface{}, operation int) (interface{}, error) LexerAndEval(lexerArg string, arg interface{}) (interface{}, error) }
q:为什么要拆分表达式编译和执行步骤?优化性能,如果需要可以缓存表达式编译结果,执行表达式时不需要重复编译 表达式引擎接口
type NodeChoose ¶
type NodeChoose struct {
// contains filtered or unexported fields
}
func (*NodeChoose) Type ¶
func (it *NodeChoose) Type() NodeType
type NodeConfigHolder ¶
type NodeConfigHolder struct { Convert SqlArgTypeConvert Proxy ExpressionEngine }
func (*NodeConfigHolder) GetExpressionEngineProxy ¶
func (it *NodeConfigHolder) GetExpressionEngineProxy() ExpressionEngine
func (*NodeConfigHolder) GetSqlArgTypeConvert ¶
func (it *NodeConfigHolder) GetSqlArgTypeConvert() SqlArgTypeConvert
type NodeForEach ¶
type NodeForEach struct {
// contains filtered or unexported fields
}
foreach 节点
func (*NodeForEach) Type ¶
func (it *NodeForEach) Type() NodeType
type NodeInclude ¶
type NodeInclude struct {
// contains filtered or unexported fields
}
func (*NodeInclude) Type ¶
func (it *NodeInclude) Type() NodeType
type NodeOtherwise ¶
type NodeOtherwise struct {
// contains filtered or unexported fields
}
func (*NodeOtherwise) Eval ¶
func (it *NodeOtherwise) Eval(env map[string]interface{}) ([]byte, error)
func (*NodeOtherwise) Type ¶
func (it *NodeOtherwise) Type() NodeType
type NodeParser ¶
type NodeParser struct {
Holder NodeConfigHolder
}
节点解析器
func (NodeParser) ParserNodes ¶
func (it NodeParser) ParserNodes(mapperXml []etree.Token) []Node
界面为node
type NodeString ¶
type NodeString struct {
// contains filtered or unexported fields
}
字符串节点
func (*NodeString) Type ¶
func (it *NodeString) Type() NodeType
type SqlArgTypeConvert ¶
type SqlArgTypeConvert interface {
Convert(arg interface{}) string
}
表达式类型(基本类型)转换函数
Click to show internal directories.
Click to hide internal directories.