Documentation ¶
Index ¶
- type FieldSelector
- func (s *FieldSelector) AND(field, value string) *FieldSelector
- func (s *FieldSelector) Apply(v *[]string)
- func (s *FieldSelector) MAX(field string, value int) *FieldSelector
- func (s *FieldSelector) MIN(field string, value int) *FieldSelector
- func (s *FieldSelector) NOT(field, value string) *FieldSelector
- func (s *FieldSelector) OR(field string, values ...string) *FieldSelector
- func (s *FieldSelector) RANGE(field string, start, stop int) *FieldSelector
- type Opt
- type OrderBySelector
- type PageSelector
- type PageSizeSelector
- type TagSelector
- type TagsSelector
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FieldSelector ¶
type FieldSelector struct {
// contains filtered or unexported fields
}
func Field ¶
func Field() *FieldSelector
Field specifies what fields to filter the search results on Example: wowsearch.Field().AND("timezone","Europe/Paris").AND("locale", "enGB").NOT("type.type", "PVP")
func (*FieldSelector) AND ¶
func (s *FieldSelector) AND(field, value string) *FieldSelector
AND is an implicit AND operation is performed by chaining multiple AND's Example: wowsearch.Field().AND("id","123").AND("type","PVP")
func (*FieldSelector) Apply ¶
func (s *FieldSelector) Apply(v *[]string)
func (*FieldSelector) MAX ¶
func (s *FieldSelector) MAX(field string, value int) *FieldSelector
MAX operation performs a maximum value check Example: wowsearch.MAX("str",100)
func (*FieldSelector) MIN ¶
func (s *FieldSelector) MIN(field string, value int) *FieldSelector
MIN operation performs a minimum value check Example: wowsearch.MIN("str",10)
func (*FieldSelector) NOT ¶
func (s *FieldSelector) NOT(field, value string) *FieldSelector
NOT operation, multiple NOT's can be added by chaining Example: wowsearch.NOT("race","orc") Example: wowsearch.NOT("race","human")
func (*FieldSelector) OR ¶
func (s *FieldSelector) OR(field string, values ...string) *FieldSelector
OR operation is performed, you can specify multiple alternatives Example: wowsearch.Field().OR("str","5","10") Example: wowsearch.Field().OR("type","man","bear","pig")
func (*FieldSelector) RANGE ¶
func (s *FieldSelector) RANGE(field string, start, stop int) *FieldSelector
RANGE operation is performed only on numeric field values Example: wowsearch.RANGE("str",2,99)
type Opt ¶
type Opt interface {
Apply(*[]string)
}
Opt is the interface for options passed to the search functions
type OrderBySelector ¶
type OrderBySelector struct {
// contains filtered or unexported fields
}
func OrderBy ¶
func OrderBy(fields ...string) *OrderBySelector
OrderBy accepts a list of fields and sorts the result in order of those fields. :asc and :desc can be appended to each field to instruct the search endpoint to sort in ascending or descending order. Example: wowsearch.OrderBy("field1") Example: wowsearch.OrderBy("field1:asc") Example: wowsearch.OrderBy("field1:desc") Example: wowsearch.OrderBy("field1", "field2") Example: wowsearch.OrderBy("field1:desc", "field2:asc")
func (*OrderBySelector) Apply ¶
func (s *OrderBySelector) Apply(v *[]string)
type PageSelector ¶
type PageSelector struct {
// contains filtered or unexported fields
}
func (*PageSelector) Apply ¶
func (s *PageSelector) Apply(v *[]string)
type PageSizeSelector ¶
type PageSizeSelector struct {
// contains filtered or unexported fields
}
func PageSize ¶
func PageSize(size int) *PageSizeSelector
PageSize specifies the size of each page in the result. The default value is 100 and can support a minimum of 1 or a maximum of 1000. If size provided is < 1 it will be set to 1, if it's > 1000 it will be set to 1000. Example: wowsearch.PageSize(20) // Will return 20 items Example: wowsearch.PageSize(1337) // Size will be set to 1000 Example: wowsearch.PageSize(-2) // Size will be set to 1
func (*PageSizeSelector) Apply ¶
func (s *PageSizeSelector) Apply(v *[]string)
type TagSelector ¶
type TagSelector struct {
// contains filtered or unexported fields
}
func Tag ¶
func Tag(value string) *TagSelector
Tag is used only for media documents. Specifies the type of media document (item, spell, creature-display, etc) to query. Example: wowsearch.Tag("item")
func (*TagSelector) Apply ¶
func (s *TagSelector) Apply(v *[]string)
type TagsSelector ¶
type TagsSelector struct {
// contains filtered or unexported fields
}
func Tags ¶
func Tags(value ...string) *TagsSelector
Tags is used only for media documents. Specifies the type of media document (item, spell, creature-display, etc) to query. Example: wowsearch.Tag("item")
func (*TagsSelector) Apply ¶
func (s *TagsSelector) Apply(v *[]string)