Documentation
¶
Index ¶
- func All(validators ...IValidator) *all
- func AllArgs(validator ISingleArgumentValidator) *allArgs
- func Arg(i int, validator ISingleArgumentValidator) *arg
- func AtLeastNArgs(n int) *atLeastNArgs
- func AtMostNArgs(n int) *atMostNArgs
- func ExactlyNArgs(n int) *exactlyNArgs
- func IfArgPresent(i int, validator IValidator) *ifArgPresent
- func OneOf(validators ...IValidator) *oneOf
- func SameFamily(f datavalues.Family) *sameFamily
- func SameType(idx ...int) *sameType
- func SingleOneOf(validators ...ISingleArgumentValidator) *singleOneOf
- func TypeOf(wantedType datavalues.IDataValue) *typeOf
- func Walk(visit Visit, exprs ...IExpression) error
- type AggregateExpression
- func (e *AggregateExpression) Document() docs.Documentation
- func (e *AggregateExpression) Eval() error
- func (e *AggregateExpression) Merge(arg IExpression) (datavalues.IDataValue, error)
- func (e *AggregateExpression) Result() datavalues.IDataValue
- func (e *AggregateExpression) String() string
- func (e *AggregateExpression) Update(params IParams) (datavalues.IDataValue, error)
- func (e *AggregateExpression) Walk(visit Visit) error
- type AliasedExpression
- func (e *AliasedExpression) Document() docs.Documentation
- func (e *AliasedExpression) Eval() error
- func (e *AliasedExpression) Merge(arg IExpression) (datavalues.IDataValue, error)
- func (e *AliasedExpression) Result() datavalues.IDataValue
- func (e *AliasedExpression) String() string
- func (e *AliasedExpression) Update(params IParams) (datavalues.IDataValue, error)
- func (e *AliasedExpression) Walk(visit Visit) error
- type BinaryExpression
- func (e *BinaryExpression) Document() docs.Documentation
- func (e *BinaryExpression) Eval() error
- func (e *BinaryExpression) Merge(arg IExpression) (datavalues.IDataValue, error)
- func (e *BinaryExpression) Result() datavalues.IDataValue
- func (e *BinaryExpression) String() string
- func (e *BinaryExpression) Update(params IParams) (datavalues.IDataValue, error)
- func (e *BinaryExpression) Walk(visit Visit) error
- type ConstantExpression
- func (e *ConstantExpression) Document() docs.Documentation
- func (e *ConstantExpression) Eval() error
- func (e *ConstantExpression) Merge(arg IExpression) (datavalues.IDataValue, error)
- func (e *ConstantExpression) Result() datavalues.IDataValue
- func (e *ConstantExpression) String() string
- func (e *ConstantExpression) Update(params IParams) (datavalues.IDataValue, error)
- func (e *ConstantExpression) Walk(visit Visit) error
- type IExpression
- func ADD(left interface{}, right interface{}) IExpression
- func ALIASED(name string, expr IExpression) IExpression
- func AND(left interface{}, right interface{}) IExpression
- func CONST(v interface{}) IExpression
- func COUNT(arg interface{}) IExpression
- func DIV(left interface{}, right interface{}) IExpression
- func EQ(left interface{}, right interface{}) IExpression
- func ExpressionFactory(name string, args []interface{}) (IExpression, error)
- func GT(left interface{}, right interface{}) IExpression
- func GTE(left interface{}, right interface{}) IExpression
- func IF(args ...interface{}) IExpression
- func LIKE(left interface{}, right interface{}) IExpression
- func LOGMOCK(args ...interface{}) IExpression
- func LT(left interface{}, right interface{}) IExpression
- func LTE(left interface{}, right interface{}) IExpression
- func MAX(arg interface{}) IExpression
- func MIN(arg interface{}) IExpression
- func MUL(left interface{}, right interface{}) IExpression
- func NEQ(left interface{}, right interface{}) IExpression
- func NOT_LIKE(left interface{}, right interface{}) IExpression
- func OR(left interface{}, right interface{}) IExpression
- func RANDTABLE(args ...interface{}) IExpression
- func RANGETABLE(args ...interface{}) IExpression
- func SUB(left interface{}, right interface{}) IExpression
- func SUM(arg interface{}) IExpression
- func VAR(v string) IExpression
- func ZIP(args ...interface{}) IExpression
- type IParams
- type ISingleArgumentValidator
- type IValidator
- type Map
- type ScalarExpression
- func (e *ScalarExpression) Document() docs.Documentation
- func (e *ScalarExpression) Eval() error
- func (e *ScalarExpression) Merge(arg IExpression) (datavalues.IDataValue, error)
- func (e *ScalarExpression) Result() datavalues.IDataValue
- func (e *ScalarExpression) String() string
- func (e *ScalarExpression) Update(params IParams) (datavalues.IDataValue, error)
- func (e *ScalarExpression) Walk(visit Visit) error
- type VariableExpression
- func (e *VariableExpression) Document() docs.Documentation
- func (e *VariableExpression) Eval() error
- func (e *VariableExpression) Merge(arg IExpression) (datavalues.IDataValue, error)
- func (e *VariableExpression) Result() datavalues.IDataValue
- func (e *VariableExpression) String() string
- func (e *VariableExpression) Update(params IParams) (datavalues.IDataValue, error)
- func (e *VariableExpression) Walk(visit Visit) error
- type Visit
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func All ¶
func All(validators ...IValidator) *all
func AllArgs ¶
func AllArgs(validator ISingleArgumentValidator) *allArgs
func Arg ¶
func Arg(i int, validator ISingleArgumentValidator) *arg
func AtLeastNArgs ¶
func AtLeastNArgs(n int) *atLeastNArgs
func AtMostNArgs ¶
func AtMostNArgs(n int) *atMostNArgs
func ExactlyNArgs ¶
func ExactlyNArgs(n int) *exactlyNArgs
func IfArgPresent ¶
func IfArgPresent(i int, validator IValidator) *ifArgPresent
func OneOf ¶
func OneOf(validators ...IValidator) *oneOf
func SameFamily ¶
func SameFamily(f datavalues.Family) *sameFamily
func SingleOneOf ¶
func SingleOneOf(validators ...ISingleArgumentValidator) *singleOneOf
func TypeOf ¶
func TypeOf(wantedType datavalues.IDataValue) *typeOf
func Walk ¶
func Walk(visit Visit, exprs ...IExpression) error
Types ¶
type AggregateExpression ¶
type AggregateExpression struct {
// contains filtered or unexported fields
}
func (*AggregateExpression) Document ¶
func (e *AggregateExpression) Document() docs.Documentation
func (*AggregateExpression) Eval ¶
func (e *AggregateExpression) Eval() error
func (*AggregateExpression) Merge ¶
func (e *AggregateExpression) Merge(arg IExpression) (datavalues.IDataValue, error)
func (*AggregateExpression) Result ¶
func (e *AggregateExpression) Result() datavalues.IDataValue
func (*AggregateExpression) String ¶
func (e *AggregateExpression) String() string
func (*AggregateExpression) Update ¶
func (e *AggregateExpression) Update(params IParams) (datavalues.IDataValue, error)
func (*AggregateExpression) Walk ¶
func (e *AggregateExpression) Walk(visit Visit) error
type AliasedExpression ¶
type AliasedExpression struct {
// contains filtered or unexported fields
}
func NewAliasedExpression ¶
func NewAliasedExpression(name string, expr IExpression) *AliasedExpression
func (*AliasedExpression) Document ¶
func (e *AliasedExpression) Document() docs.Documentation
func (*AliasedExpression) Eval ¶
func (e *AliasedExpression) Eval() error
func (*AliasedExpression) Merge ¶
func (e *AliasedExpression) Merge(arg IExpression) (datavalues.IDataValue, error)
func (*AliasedExpression) Result ¶
func (e *AliasedExpression) Result() datavalues.IDataValue
func (*AliasedExpression) String ¶
func (e *AliasedExpression) String() string
func (*AliasedExpression) Update ¶
func (e *AliasedExpression) Update(params IParams) (datavalues.IDataValue, error)
func (*AliasedExpression) Walk ¶
func (e *AliasedExpression) Walk(visit Visit) error
type BinaryExpression ¶
type BinaryExpression struct {
// contains filtered or unexported fields
}
func (*BinaryExpression) Document ¶
func (e *BinaryExpression) Document() docs.Documentation
func (*BinaryExpression) Eval ¶
func (e *BinaryExpression) Eval() error
func (*BinaryExpression) Merge ¶
func (e *BinaryExpression) Merge(arg IExpression) (datavalues.IDataValue, error)
func (*BinaryExpression) Result ¶
func (e *BinaryExpression) Result() datavalues.IDataValue
func (*BinaryExpression) String ¶
func (e *BinaryExpression) String() string
func (*BinaryExpression) Update ¶
func (e *BinaryExpression) Update(params IParams) (datavalues.IDataValue, error)
func (*BinaryExpression) Walk ¶
func (e *BinaryExpression) Walk(visit Visit) error
type ConstantExpression ¶
type ConstantExpression struct {
// contains filtered or unexported fields
}
ConstantExpression 常量表达式,返回给定的值
func NewConstantExpression ¶
func NewConstantExpression(v datavalues.IDataValue) *ConstantExpression
func (*ConstantExpression) Document ¶
func (e *ConstantExpression) Document() docs.Documentation
func (*ConstantExpression) Merge ¶
func (e *ConstantExpression) Merge(arg IExpression) (datavalues.IDataValue, error)
Merge 妈的常量值竟然能被覆盖掉?
func (*ConstantExpression) Result ¶
func (e *ConstantExpression) Result() datavalues.IDataValue
Result 返回最终的常量
func (*ConstantExpression) String ¶
func (e *ConstantExpression) String() string
func (*ConstantExpression) Update ¶
func (e *ConstantExpression) Update(params IParams) (datavalues.IDataValue, error)
Update 常量没有参数
type IExpression ¶
type IExpression interface { // Eval 执行表达式 Eval() error // Result 获取表达式的执行结果 Result() datavalues.IDataValue // Update 设置表达式的参数 Update(params IParams) (datavalues.IDataValue, error) // Merge 合并多个表达式的结果 Merge(arg IExpression) (datavalues.IDataValue, error) Walk(visit Visit) error String() string // Document 表达式的执行结果 Document() docs.Documentation }
IExpression 表示SQL中的一个表达式
func ADD ¶
func ADD(left interface{}, right interface{}) IExpression
func ALIASED ¶
func ALIASED(name string, expr IExpression) IExpression
func AND ¶
func AND(left interface{}, right interface{}) IExpression
func COUNT ¶
func COUNT(arg interface{}) IExpression
func DIV ¶
func DIV(left interface{}, right interface{}) IExpression
func EQ ¶
func EQ(left interface{}, right interface{}) IExpression
func ExpressionFactory ¶
func ExpressionFactory(name string, args []interface{}) (IExpression, error)
func GT ¶
func GT(left interface{}, right interface{}) IExpression
func GTE ¶
func GTE(left interface{}, right interface{}) IExpression
func LIKE ¶
func LIKE(left interface{}, right interface{}) IExpression
func LOGMOCK ¶
func LOGMOCK(args ...interface{}) IExpression
func LT ¶
func LT(left interface{}, right interface{}) IExpression
func LTE ¶
func LTE(left interface{}, right interface{}) IExpression
func MAX ¶
func MAX(arg interface{}) IExpression
func MIN ¶
func MIN(arg interface{}) IExpression
func MUL ¶
func MUL(left interface{}, right interface{}) IExpression
func NEQ ¶
func NEQ(left interface{}, right interface{}) IExpression
func NOT_LIKE ¶
func NOT_LIKE(left interface{}, right interface{}) IExpression
func OR ¶
func OR(left interface{}, right interface{}) IExpression
func RANDTABLE ¶
func RANDTABLE(args ...interface{}) IExpression
func RANGETABLE ¶
func RANGETABLE(args ...interface{}) IExpression
func SUB ¶
func SUB(left interface{}, right interface{}) IExpression
func SUM ¶
func SUM(arg interface{}) IExpression
func VAR ¶
func VAR(v string) IExpression
func ZIP ¶
func ZIP(args ...interface{}) IExpression
type IParams ¶
type IParams interface {
Get(name string) (datavalues.IDataValue, bool)
}
type ISingleArgumentValidator ¶
type ISingleArgumentValidator interface { docs.Documented Validate(arg datavalues.IDataValue) error }
type IValidator ¶
type IValidator interface { docs.Documented Validate(args ...datavalues.IDataValue) error }
type Map ¶
type Map map[string]datavalues.IDataValue
func (Map) Get ¶
func (p Map) Get(name string) (datavalues.IDataValue, bool)
type ScalarExpression ¶
type ScalarExpression struct {
// contains filtered or unexported fields
}
func (*ScalarExpression) Document ¶
func (e *ScalarExpression) Document() docs.Documentation
func (*ScalarExpression) Eval ¶
func (e *ScalarExpression) Eval() error
func (*ScalarExpression) Merge ¶
func (e *ScalarExpression) Merge(arg IExpression) (datavalues.IDataValue, error)
func (*ScalarExpression) Result ¶
func (e *ScalarExpression) Result() datavalues.IDataValue
func (*ScalarExpression) String ¶
func (e *ScalarExpression) String() string
func (*ScalarExpression) Update ¶
func (e *ScalarExpression) Update(params IParams) (datavalues.IDataValue, error)
func (*ScalarExpression) Walk ¶
func (e *ScalarExpression) Walk(visit Visit) error
type VariableExpression ¶
type VariableExpression struct {
// contains filtered or unexported fields
}
func NewVariableExpression ¶
func NewVariableExpression(v string) *VariableExpression
func (*VariableExpression) Document ¶
func (e *VariableExpression) Document() docs.Documentation
func (*VariableExpression) Eval ¶
func (e *VariableExpression) Eval() error
func (*VariableExpression) Merge ¶
func (e *VariableExpression) Merge(arg IExpression) (datavalues.IDataValue, error)
func (*VariableExpression) Result ¶
func (e *VariableExpression) Result() datavalues.IDataValue
func (*VariableExpression) String ¶
func (e *VariableExpression) String() string
func (*VariableExpression) Update ¶
func (e *VariableExpression) Update(params IParams) (datavalues.IDataValue, error)
func (*VariableExpression) Walk ¶
func (e *VariableExpression) Walk(visit Visit) error
type Visit ¶
type Visit func(e IExpression) (isContinue bool, err error)
Source Files
¶
- expression.go
- expression_aggregate.go
- expression_aggregator.go
- expression_airthmetic.go
- expression_aliased.go
- expression_binary.go
- expression_condition.go
- expression_constant.go
- expression_factory.go
- expression_if.go
- expression_param.go
- expression_scalar.go
- expression_tvf.go
- expression_validator.go
- expression_variable.go
Click to show internal directories.
Click to hide internal directories.