Documentation
¶
Index ¶
- Constants
- func ParseVagueDateTime(some string) (time.Time, error)
- func Prepare(d *database.Database, statement string) (database.Filters, error)
- type ASTNode
- type BaseNode
- type BinaryOpNode
- type NumberNode
- type Numeric
- type Parser
- type QuantifierNode
- type QueryNode
- type Scanner
- func (s *Scanner) Emit() Token
- func (s *Scanner) MatchIdentifier() int
- func (s *Scanner) MatchNumber() int
- func (s *Scanner) MatchTimeWhence() int
- func (s *Scanner) MatchTimespan() int
- func (s *Scanner) MatchTopic() int
- func (s *Scanner) Rewind()
- func (s *Scanner) SkipToBoundary(boundary boundaryFunc) int
- type SyntaxError
- type TimeExpressionNode
- type TimePredicateNode
- type TimeWhenceNode
- type TimespanNode
- type Token
- type TokenType
- type TopicNode
- type TopicSelectorNode
Constants ¶
View Source
const ( TOK_INVALID = iota TOK_EOF TOK_NL TOK_IDENTIFIER TOK_KEYWORD TOK_NUMBER TOK_STRING TOK_TOPIC TOK_COMMA // Arithmetic TOK_PLUS TOK_MINUS TOK_STAR // Time TOK_WHENCE TOK_TIMESPAN TOK_PAREN_L TOK_PAREN_R TOK_ARROW )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BaseNode ¶
type BaseNode struct {
Value string
// contains filtered or unexported fields
}
func (*BaseNode) GenerateFilter ¶
type BinaryOpNode ¶
type BinaryOpNode struct {
BaseNode
}
func (BinaryOpNode) DerivedValue ¶
func (b BinaryOpNode) DerivedValue() int64
type NumberNode ¶
type NumberNode struct {
BaseNode
}
func (NumberNode) DerivedValue ¶
func (n NumberNode) DerivedValue() int64
type QuantifierNode ¶
type QuantifierNode struct {
BaseNode
}
func (QuantifierNode) GenerateFilter ¶
func (q QuantifierNode) GenerateFilter(db *database.Database) database.Filter
type Scanner ¶
func (*Scanner) MatchIdentifier ¶
MatchIdentifier returns the length of the next token, assuming it is an identifier.
Grammar:
identifier = 1*(ALPHA / DIGIT)
func (*Scanner) MatchNumber ¶
MatchNumber returns the length of the next token, assuming it is a number
Grammar:
number = 1*DIGIT
func (*Scanner) MatchTimeWhence ¶
MatchTimeWhence returns the length of the next token, assuming it is a time-whence
Grammar:
time-whence = "~now" / "~" RFC3339
func (*Scanner) MatchTimespan ¶
MatchTimespan returns the length of the next token, assuming it is a timespan
Grammar:
timespan = "@second" / "@minute" / "@hour" / "@day" / "@week" / "@month" / "@year"
func (*Scanner) MatchTopic ¶
MatchTopic returns the length of the next token, assuming it is a topic string.
Grammar:
topic = "/" 1*(ALPHA / DIGIT / "/")
func (*Scanner) SkipToBoundary ¶
SkipToBoundary returns the number of bytes until the next delimiter. This is useful for skipping over invalid tokens.
type SyntaxError ¶
func NewSyntaxError ¶
func NewSyntaxError(t Token, m string) SyntaxError
func (*SyntaxError) FormatError ¶
func (s *SyntaxError) FormatError(input string) string
type TimeExpressionNode ¶
type TimeExpressionNode struct {
BaseNode
}
func (TimeExpressionNode) Time ¶
func (t TimeExpressionNode) Time() time.Time
type TimePredicateNode ¶
type TimePredicateNode struct {
BaseNode
}
func (TimePredicateNode) GenerateFilter ¶
func (t TimePredicateNode) GenerateFilter(db *database.Database) database.Filter
type TimeWhenceNode ¶
func (TimeWhenceNode) Time ¶
func (t TimeWhenceNode) Time() time.Time
type TimespanNode ¶
type TimespanNode struct {
BaseNode
}
func (TimespanNode) DerivedValue ¶
func (t TimespanNode) DerivedValue() int64
type TopicSelectorNode ¶
type TopicSelectorNode struct {
BaseNode
}
func (TopicSelectorNode) GenerateFilter ¶
func (q TopicSelectorNode) GenerateFilter(db *database.Database) database.Filter
Click to show internal directories.
Click to hide internal directories.