elastic

package
v0.0.0-...-149ce59 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2018 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewInfoFinder

func NewInfoFinder(elastic *Elastic) db.InfoFinder

Types

type Elastic

type Elastic struct {
	// contains filtered or unexported fields
}

func CreateDatabase

func CreateDatabase(url string, index string) (*Elastic, error)

func (*Elastic) AddAlert

func (es *Elastic) AddAlert(alerts ...*cap.Alert) error

func (*Elastic) AlertExists

func (es *Elastic) AlertExists(reference *cap.Reference) (bool, error)

func (*Elastic) GetAlert

func (es *Elastic) GetAlert(reference *cap.Reference) (*cap.Alert, error)

func (*Elastic) GetAlertById

func (es *Elastic) GetAlertById(id string) (*cap.Alert, error)

func (*Elastic) NewInfoFinder

func (es *Elastic) NewInfoFinder() db.InfoFinder

func (*Elastic) Setup

func (es *Elastic) Setup() error

type GeoShapeQuery

type GeoShapeQuery struct {
	// contains filtered or unexported fields
}

GeoShapeQuery allows to include hits that match a geoshape

For more details, see: https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-geo-shape-query.html

func NewGeoShapeQuery

func NewGeoShapeQuery(name string) *GeoShapeQuery

NewGeoShapeQuery creates and initializes a new GeoShapeQuery.

func (*GeoShapeQuery) QueryName

func (q *GeoShapeQuery) QueryName(queryName string) *GeoShapeQuery

func (*GeoShapeQuery) SetPoint

func (q *GeoShapeQuery) SetPoint(lat, lon float64) *GeoShapeQuery

SetPoint adds a point from latitude and longitude.

func (*GeoShapeQuery) SetPolygon

func (q *GeoShapeQuery) SetPolygon(points [][][]float64) *GeoShapeQuery

SetPolygon adds a polygon from a list of latitude and longitude.

func (*GeoShapeQuery) SetRelation

func (q *GeoShapeQuery) SetRelation(rel string) *GeoShapeQuery

SetRelation sets the geoJSON relation for the query

func (*GeoShapeQuery) Source

func (q *GeoShapeQuery) Source() (interface{}, error)

Source returns JSON for the function score query.

type InfoFinder

type InfoFinder struct {
	// contains filtered or unexported fields
}

func (*InfoFinder) AlertId

func (f *InfoFinder) AlertId(id string) db.InfoFinder

* FILTERS *

func (*InfoFinder) Area

func (f *InfoFinder) Area(area string) db.InfoFinder

func (*InfoFinder) Certainty

func (f *InfoFinder) Certainty(certainty cap.Certainty) db.InfoFinder

func (*InfoFinder) Count

func (f *InfoFinder) Count(count int) db.InfoFinder

func (*InfoFinder) Description

func (f *InfoFinder) Description(description string) db.InfoFinder

func (*InfoFinder) EffectiveGt

func (f *InfoFinder) EffectiveGt(t time.Time) db.InfoFinder

func (*InfoFinder) EffectiveGte

func (f *InfoFinder) EffectiveGte(t time.Time) db.InfoFinder

func (*InfoFinder) EffectiveLt

func (f *InfoFinder) EffectiveLt(t time.Time) db.InfoFinder

func (*InfoFinder) EffectiveLte

func (f *InfoFinder) EffectiveLte(t time.Time) db.InfoFinder

func (*InfoFinder) ExpiresGt

func (f *InfoFinder) ExpiresGt(t time.Time) db.InfoFinder

func (*InfoFinder) ExpiresGte

func (f *InfoFinder) ExpiresGte(t time.Time) db.InfoFinder

func (*InfoFinder) ExpiresLt

func (f *InfoFinder) ExpiresLt(t time.Time) db.InfoFinder

func (*InfoFinder) ExpiresLte

func (f *InfoFinder) ExpiresLte(t time.Time) db.InfoFinder

func (*InfoFinder) Find

func (f *InfoFinder) Find() (*db.InfoResults, error)

* FIND *

func (*InfoFinder) Headline

func (f *InfoFinder) Headline(headline string) db.InfoFinder

func (*InfoFinder) Instruction

func (f *InfoFinder) Instruction(instruction string) db.InfoFinder

func (*InfoFinder) Language

func (f *InfoFinder) Language(language string) db.InfoFinder

func (*InfoFinder) MessageType

func (f *InfoFinder) MessageType(messageType cap.MessageType) db.InfoFinder

func (*InfoFinder) OnsetGt

func (f *InfoFinder) OnsetGt(t time.Time) db.InfoFinder

func (*InfoFinder) OnsetGte

func (f *InfoFinder) OnsetGte(t time.Time) db.InfoFinder

func (*InfoFinder) OnsetLt

func (f *InfoFinder) OnsetLt(t time.Time) db.InfoFinder

func (*InfoFinder) OnsetLte

func (f *InfoFinder) OnsetLte(t time.Time) db.InfoFinder

func (*InfoFinder) Point

func (f *InfoFinder) Point(lat, lon float64) db.InfoFinder

func (*InfoFinder) Scope

func (f *InfoFinder) Scope(scope cap.Scope) db.InfoFinder

func (*InfoFinder) Severity

func (f *InfoFinder) Severity(severity cap.Severity) db.InfoFinder

func (*InfoFinder) Sort

func (f *InfoFinder) Sort(fields ...string) db.InfoFinder

* SORTING *

func (*InfoFinder) Start

func (f *InfoFinder) Start(start int) db.InfoFinder

* PAGINATION *

func (*InfoFinder) Status

func (f *InfoFinder) Status(status cap.Status) db.InfoFinder

func (*InfoFinder) Superseded

func (f *InfoFinder) Superseded(superseded bool) db.InfoFinder

func (*InfoFinder) Urgency

func (f *InfoFinder) Urgency(urgency cap.Urgency) db.InfoFinder

Jump to

Keyboard shortcuts

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