Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsDurationLiteral ¶
IsDurationLiteral checks if a string is a valid duration literal
Types ¶
type BinaryExpr ¶
type BinaryExpr struct {
Op string // "AND", "OR"
Left FilterExpr
Right FilterExpr
}
BinaryExpr represents AND, OR operations
type CompareExpr ¶
type CompareExpr struct {
Field string // "status", "type", "assignee", "priority", "points", "createdat", "updatedat", "tags"
Op string // "=", "==", "!=", ">", "<", ">=", "<="
Value interface{} // string, int, or TimeExpr
}
CompareExpr represents comparisons like status = 'ready' or Priority < 3
type DurationValue ¶
DurationValue represents a parsed duration for comparison
type FilterExpr ¶
FilterExpr represents a filter expression that can be evaluated against a task
func ParseFilter ¶
func ParseFilter(expr string) (FilterExpr, error)
ParseFilter parses a filter expression string into an AST. This is the main public entry point for filter parsing.
Example expressions:
- status = 'done'
- type = 'bug' AND priority > 2
- status IN ['ready', 'in_progress']
- NOW - CreatedAt < 24hour
- (status = 'ready' OR status = 'in_progress') AND priority >= 3
Returns nil expression for empty string (no filtering).
type InExpr ¶
type InExpr struct {
Field string // "status", "type", "tags", etc.
Not bool // true for NOT IN, false for IN
Values []interface{} // List of values to check against (strings, ints, etc.)
}
InExpr represents IN/NOT IN operations like: tags IN ['ui', 'charts', 'viz']
type TimeExpr ¶
type TimeExpr struct {
Base string // "NOW", "CreatedAt", "UpdatedAt"
Op string // "+", "-"
Operand interface{} // time.Duration or field name string
}
TimeExpr represents time arithmetic like NOW - 24hour or NOW - CreatedAt
type TokenType ¶
type TokenType int
TokenType represents the type of a lexer token
const ( TokenEOF TokenType = iota TokenIdent // field names like status, type, NOW, CURRENT_USER TokenString // 'value' or "value" TokenNumber // integer literals TokenDuration // 24hour, 1week, etc. TokenOperator // =, ==, !=, >, <, >=, <=, +, - TokenAnd TokenOr TokenNot TokenIn // IN keyword TokenNotIn // NOT IN keyword combination TokenLParen TokenRParen TokenLBracket // [ for list literals TokenRBracket // ] for list literals TokenComma // , for list elements )