Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Comparator ¶
type Comparator struct {
// contains filtered or unexported fields
}
Comparator object
func NewComparator ¶
func NewComparator(client elasticsearch.Client, index string) Comparator
NewComparator returns a new comparator for the given index and elasticsearch client
func (*Comparator) Compare ¶
func (c *Comparator) Compare(field, query string, stat Stat, value float64, tolerancy int) (string, error)
Compare returns error if value does not meet the tolerance as compared with the field extracted from the given query
Where field is the field we want to compare, query is the query string to use for the search, stat is the type of aggregation to compare with value and toleration is the percentaje difference tolerated, it can negative it returns an error when the field doesn't meet the tolerancy, and an informative message when it does
type QueryStringResponse ¶
type QueryStringResponse struct { Aggregations struct { // contains filtered or unexported fields } `json:"aggregations"` }
Type to store query response
Click to show internal directories.
Click to hide internal directories.