Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BooleanQuery ¶
type BooleanQuery struct {
Must []Filter // AND conditions
Should []Filter // OR conditions
MustNot []Filter // NOT conditions
Nested *BooleanQuery // Nested boolean query (for parentheses)
}
BooleanQuery represents a boolean combination of filters
type Builder ¶
type Builder struct{}
Builder handles converting queries into SQL
func (*Builder) BuildConditions ¶
func (b *Builder) BuildConditions(bq *BooleanQuery) ([]string, []interface{}, error)
type FieldType ¶ added in v0.4.0
type FieldType string
FieldType represents the type of field being queried
type Filter ¶
type Filter struct {
Field []string // Field to filter on (e.g., "metadata.owner")
FieldType FieldType // Type of field (metadata, type, provider, kind)
Operator Operator // Operator (e.g., =, :, contains)
Value interface{} // Value to compare against
Range *RangeValue // Range values for range queries
OrigQuery string
}
Filter represents a single filter condition
type Operator ¶
type Operator string
Operator represents the type of filter operation
const ( OpEquals Operator = "=" OpContains Operator = "contains" OpNotEquals Operator = "!=" OpGreater Operator = ">" OpLess Operator = "<" OpGreaterEqual Operator = ">=" OpLessEqual Operator = "<=" OpIn Operator = "in" OpNotIn Operator = "not in" OpRange Operator = "range" OpWildcard Operator = "wildcard" OpFreeText Operator = "freetext" )
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
Parser handles parsing of search queries into structured formats
type Query ¶
type Query struct {
FreeText string // General text search
Filters []Filter // Specific field filters
Bool *BooleanQuery // Boolean combinations of filters
}
Query represents a parsed search query with specific conditions
type RangeValue ¶
type RangeValue struct {
From interface{}
To interface{}
Inclusive bool
}
RangeValue represents a range query with optional bounds
Click to show internal directories.
Click to hide internal directories.