Documentation
¶
Index ¶
- type Builder
- func (b *Builder) AllTags(tags ...string) *FilterBuilder
- func (b *Builder) AnyTags(tags ...string) *FilterBuilder
- func (b *Builder) MatchAll() *FilterBuilder
- func (b *Builder) Metadata(key string, value interface{}) *FilterBuilder
- func (b *Builder) MetadataMatch(matches map[string]interface{}) *FilterBuilder
- func (b *Builder) Name(name string) *FilterBuilder
- func (b *Builder) NamePattern(pattern string) *FilterBuilder
- func (b *Builder) Path(path string) *FilterBuilder
- func (b *Builder) PathGlob(pattern string) *FilterBuilder
- func (b *Builder) PathPrefix(prefix string) *FilterBuilder
- func (b *Builder) Tag(tag string) *FilterBuilder
- func (b *Builder) Tags(tags ...string) *FilterBuilder
- func (b *Builder) Type(type_ string) *FilterBuilder
- func (b *Builder) Types(types ...string) *FilterBuilder
- type FilterBuilder
- type Option
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder provides methods for creating command filters
func (*Builder) AllTags ¶
func (b *Builder) AllTags(tags ...string) *FilterBuilder
AllTags creates a filter that matches commands having all the given tags
func (*Builder) AnyTags ¶
func (b *Builder) AnyTags(tags ...string) *FilterBuilder
AnyTags is an alias for Tags
func (*Builder) MatchAll ¶
func (b *Builder) MatchAll() *FilterBuilder
MatchAll creates a filter that matches all commands
func (*Builder) Metadata ¶
func (b *Builder) Metadata(key string, value interface{}) *FilterBuilder
Metadata creates a filter that matches commands by metadata field value
func (*Builder) MetadataMatch ¶
func (b *Builder) MetadataMatch(matches map[string]interface{}) *FilterBuilder
MetadataMatch creates a filter that matches commands by multiple metadata fields
func (*Builder) Name ¶
func (b *Builder) Name(name string) *FilterBuilder
Name creates a filter that matches commands by exact name
func (*Builder) NamePattern ¶
func (b *Builder) NamePattern(pattern string) *FilterBuilder
NamePattern creates a filter that matches commands by name pattern
func (*Builder) Path ¶
func (b *Builder) Path(path string) *FilterBuilder
Path creates a filter that matches commands by exact path
func (*Builder) PathGlob ¶
func (b *Builder) PathGlob(pattern string) *FilterBuilder
PathGlob creates a filter that matches commands by path glob pattern
func (*Builder) PathPrefix ¶
func (b *Builder) PathPrefix(prefix string) *FilterBuilder
PathPrefix creates a filter that matches commands by path prefix
func (*Builder) Tag ¶
func (b *Builder) Tag(tag string) *FilterBuilder
Tag creates a filter that matches commands having a specific tag
func (*Builder) Tags ¶
func (b *Builder) Tags(tags ...string) *FilterBuilder
Tags creates a filter that matches commands having any of the given tags
func (*Builder) Type ¶
func (b *Builder) Type(type_ string) *FilterBuilder
Type creates a filter that matches commands by type
func (*Builder) Types ¶
func (b *Builder) Types(types ...string) *FilterBuilder
Types creates a filter that matches commands by any of the given types
type FilterBuilder ¶
type FilterBuilder struct {
// contains filtered or unexported fields
}
FilterBuilder provides methods for building and combining filters
func Must ¶
func Must(filter *FilterBuilder, err error) *FilterBuilder
Must is a helper that panics if err is not nil
func NewFilter ¶
func NewFilter(q query.Query) *FilterBuilder
NewFilter creates a new FilterBuilder from a raw query
func NewFilterBuilder ¶
func NewFilterBuilder(q query.Query, opts *Options) *FilterBuilder
NewFilterBuilder creates a new FilterBuilder with the given query and options
func (*FilterBuilder) And ¶
func (f *FilterBuilder) And(others ...*FilterBuilder) *FilterBuilder
And combines this filter with others using AND logic
func (*FilterBuilder) Build ¶
func (f *FilterBuilder) Build() query.Query
Build returns the underlying Bleve query
func (*FilterBuilder) Or ¶
func (f *FilterBuilder) Or(others ...*FilterBuilder) *FilterBuilder
Or combines this filter with others using OR logic
type Option ¶
type Option func(*Options)
Option is a function that configures the builder options
func WithDefaultConjunctionMinimum ¶
WithDefaultConjunctionMinimum sets the minimum number of clauses that must match for conjunction queries
func WithDefaultDisjunctionMinimum ¶
WithDefaultDisjunctionMinimum sets the minimum number of clauses that must match for disjunction queries
func WithDefaultFieldBoost ¶
WithDefaultFieldBoost sets the default boost value for field queries
type Options ¶
type Options struct { // DefaultFieldBoost is the default boost value for field queries DefaultFieldBoost float64 // DefaultConjunctionMinimum is the minimum number of clauses that must match for conjunction queries DefaultConjunctionMinimum float64 // DefaultDisjunctionMinimum is the minimum number of clauses that must match for disjunction queries DefaultDisjunctionMinimum float64 }
Options contains configuration for the query builder