elasticapi

package
v0.0.0-...-3f6b269 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2021 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const ESV1 = "1."
View Source
const ESV2 = "2."
View Source
const ESV5 = "5."

Variables

This section is empty.

Functions

func ExitOnError

func ExitOnError(err error)

Types

type ElasticInfo

type ElasticInfo struct {
	ClusterName string `json:"cluster_name"`
	Name        string `json:"name"`
	Status      int    `json:"status"`
	Tagline     string `json:"tagline"`
	Version     struct {
		BuildHash      string `json:"build_hash"`
		BuildSnapshot  bool   `json:"build_snapshot"`
		BuildTimestamp string `json:"build_timestamp"`
		LuceneVersion  string `json:"lucene_version"`
		Number         string `json:"number"`
	} `json:"version"`
}
var Info ElasticInfo

func GetElasticInfo

func GetElasticInfo(url string) (ElasticInfo, error)

*

  • GetElasticInfo from the given url and returns it to be used by the application.

type EsAPI

type EsAPI interface {
	Run(string, string, string, string, bool, int)
}

func NewClient

func NewClient(url string) (EsAPI, error)

type EsV1

type EsV1 struct {
	Client *elastic.Client

	SearchConfig struct {
		Index      string
		Query      string
		Field      string
		Buffersize int
	}
	// contains filtered or unexported fields
}

func UseClientV1

func UseClientV1(url string) EsV1

func (EsV1) GetResultString

func (Api EsV1) GetResultString(results *elastic.SearchResult) (string, timeRange)

func (EsV1) Run

func (Api EsV1) Run(url string, index string, query string, field string, realTime bool, bufferSize int)

type EsV5

type EsV5 struct {
	Client *elastic.Client

	SearchConfig struct {
		Index      string
		Query      string
		Field      string
		Buffersize int
	}
	// contains filtered or unexported fields
}

func UseClientV5

func UseClientV5(url string) EsV5

func (EsV5) GetResultString

func (Api EsV5) GetResultString(results *elastic.SearchResult) (string, timeRange)

func (EsV5) Run

func (Api EsV5) Run(url string, index string, query string, field string, realTime bool, bufferSize int)

Jump to

Keyboard shortcuts

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