wowsearch

package
v1.3.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 9, 2022 License: MIT Imports: 3 Imported by: 2

Documentation

Index

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

func Page

func Page(page int) Opt

Page specifies which page of search results to return. The default page is 1 if not specified Example:wowsearch.Page(10)

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL