Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetFieldDescription ¶
GetFieldDescription returns the description of a CQL field. Returns empty string if the field is not valid.
func GetValidFields ¶
func GetValidFields() []string
GetValidFields returns a slice of all valid field names.
func IsValidField ¶
IsValidField checks if a field name is valid in EPO CQL.
func IsValidOperator ¶
IsValidOperator checks if an operator is valid in EPO CQL.
Types ¶
type CQLQuery ¶
type CQLQuery struct {
// Raw is the original query string
Raw string
// Tokens is the parsed token stream
Tokens []CQLToken
// Valid indicates whether the query passed validation
Valid bool
// Errors contains any validation errors
Errors []string
}
CQLQuery represents a parsed CQL query.
func ParseCQL ¶
ParseCQL parses a CQL query string and returns a CQLQuery object.
Example queries:
- "ti=bluetooth"
- "ti=bluetooth AND pa=ericsson"
- "(ti=5g OR ab=5g) AND pd>=20200101"
- "pa=\"Apple Inc\" AND ic=H04W"
Returns:
- *CQLQuery: The parsed query with tokens and validation status
- error: An error if the query is completely invalid or empty
func (*CQLQuery) TokenCount ¶
TokenCount returns the number of tokens in the parsed query.
Click to show internal directories.
Click to hide internal directories.