Documentation ¶
Overview ¶
Package parser contains expression parser for search parameter.
Index ¶
- Constants
- type Boolean
- type Compare
- type Condition
- type ConditionOperand
- func (o *ConditionOperand) GetFields() []string
- func (o *ConditionOperand) MongoExprQuery() bson.M
- func (o *ConditionOperand) MongoQuery() bson.M
- func (o *ConditionOperand) NotExprQuery() bson.M
- func (o *ConditionOperand) NotMongoQuery() bson.M
- func (o *ConditionOperand) NotPostgresQuery(prefix string) (string, pgx.NamedArgs)
- func (o *ConditionOperand) PostgresQuery(prefix string) (string, pgx.NamedArgs)
- type ConditionRHS
- func (r *ConditionRHS) ExprQuery(op string) bson.M
- func (r *ConditionRHS) MongoQuery() bson.M
- func (r *ConditionRHS) NotExprQuery(op string) bson.M
- func (r *ConditionRHS) NotMongoQuery() bson.M
- func (r *ConditionRHS) NotPostgresQuery() (string, pgx.NamedArgs)
- func (r *ConditionRHS) PostgresQuery() (string, pgx.NamedArgs)
- type Contains
- type Expression
- type Like
- type NotContains
- type NotLike
- type Operand
- type OrCondition
- type Parser
- type Query
- type Term
Constants ¶
View Source
const DefaultArgsLen = 6
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Compare ¶
type Condition ¶
type Condition struct { Operand *ConditionOperand ` @@` Not *Condition `| "NOT" @@` }
type ConditionOperand ¶
type ConditionOperand struct { Operand *Operand `@@` ConditionRHS *ConditionRHS `[ @@ ]` }
func (*ConditionOperand) GetFields ¶
func (o *ConditionOperand) GetFields() []string
func (*ConditionOperand) MongoExprQuery ¶
func (o *ConditionOperand) MongoExprQuery() bson.M
func (*ConditionOperand) MongoQuery ¶
func (o *ConditionOperand) MongoQuery() bson.M
func (*ConditionOperand) NotExprQuery ¶
func (o *ConditionOperand) NotExprQuery() bson.M
func (*ConditionOperand) NotMongoQuery ¶
func (o *ConditionOperand) NotMongoQuery() bson.M
func (*ConditionOperand) NotPostgresQuery ¶
func (o *ConditionOperand) NotPostgresQuery(prefix string) (string, pgx.NamedArgs)
func (*ConditionOperand) PostgresQuery ¶
func (o *ConditionOperand) PostgresQuery(prefix string) (string, pgx.NamedArgs)
type ConditionRHS ¶
type ConditionRHS struct { Compare *Compare ` @@` Like *Like `| "LIKE" @@` NotLike *NotLike `| "NOT" "LIKE" @@` Contains *Contains `| "CONTAINS" @@` NotContains *NotContains `| "NOT" "CONTAINS" @@` }
func (*ConditionRHS) ExprQuery ¶
func (r *ConditionRHS) ExprQuery(op string) bson.M
func (*ConditionRHS) MongoQuery ¶
func (r *ConditionRHS) MongoQuery() bson.M
func (*ConditionRHS) NotExprQuery ¶
func (r *ConditionRHS) NotExprQuery(op string) bson.M
func (*ConditionRHS) NotMongoQuery ¶
func (r *ConditionRHS) NotMongoQuery() bson.M
func (*ConditionRHS) NotPostgresQuery ¶
func (r *ConditionRHS) NotPostgresQuery() (string, pgx.NamedArgs)
func (*ConditionRHS) PostgresQuery ¶
func (r *ConditionRHS) PostgresQuery() (string, pgx.NamedArgs)
type Expression ¶
type Expression struct {
Or []*OrCondition `@@ { "OR" @@ }`
}
func (*Expression) GetFields ¶
func (e *Expression) GetFields() []string
func (*Expression) MongoExprQuery ¶
func (e *Expression) MongoExprQuery() bson.M
func (*Expression) MongoQuery ¶
func (e *Expression) MongoQuery() bson.M
func (*Expression) PostgresQuery ¶
func (e *Expression) PostgresQuery(prefix string) (string, pgx.NamedArgs)
type NotContains ¶
type NotContains struct {
Operand *Operand `@@`
}
func (*NotContains) ExprQuery ¶
func (l *NotContains) ExprQuery(op string) bson.M
func (*NotContains) MongoQuery ¶
func (l *NotContains) MongoQuery() bson.M
func (*NotContains) PostgresQuery ¶
func (l *NotContains) PostgresQuery() (string, pgx.NamedArgs)
type OrCondition ¶
type OrCondition struct {
And []*Condition `@@ { "AND" @@ }`
}
func (*OrCondition) GetFields ¶
func (c *OrCondition) GetFields() []string
func (*OrCondition) MongoExprQuery ¶
func (c *OrCondition) MongoExprQuery() bson.M
func (*OrCondition) MongoQuery ¶
func (c *OrCondition) MongoQuery() bson.M
func (*OrCondition) PostgresQuery ¶
func (c *OrCondition) PostgresQuery(prefix string) (string, pgx.NamedArgs)
type Parser ¶
Parser parses expression.
type Query ¶
Click to show internal directories.
Click to hide internal directories.