elasticsearch

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2021 License: Apache-2.0 Imports: 19 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientV5

type ClientV5 es5.Client

func (*ClientV5) ExSearch

func (c *ClientV5) ExSearch(r *Request) (*Response, error)

func (*ClientV5) Version

func (c *ClientV5) Version() (string, error)

type ClientV6

type ClientV6 es6.Client

func (*ClientV6) ExSearch

func (c *ClientV6) ExSearch(r *Request) (*Response, error)

type ClientV7

type ClientV7 es7.Client

func (*ClientV7) ExSearch

func (c *ClientV7) ExSearch(r *Request) (*Response, error)

type Elasticsearch

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

func NewClient

func NewClient(options *Options) (*Elasticsearch, error)

func (*Elasticsearch) CountOverTime

func (es *Elasticsearch) CountOverTime(filter *events.Filter, interval string) (*events.Histogram, error)

func (*Elasticsearch) SearchEvents

func (es *Elasticsearch) SearchEvents(filter *events.Filter, from, size int64,
	sort string) (*events.Events, error)

func (*Elasticsearch) StatisticsOnResources

func (es *Elasticsearch) StatisticsOnResources(filter *events.Filter) (*events.Statistics, error)

type Error

type Error struct {
	Type   string `json:"type"`
	Reason string `json:"reason"`
	Status int    `json:"status"`
}

func (Error) Error

func (e Error) Error() string

type Hits

type Hits struct {
	Total int64               `json:"total"`
	Hits  jsoniter.RawMessage `json:"hits"`
}

type Options

type Options struct {
	Host        string `json:"host" yaml:"host"`
	IndexPrefix string `json:"indexPrefix,omitempty" yaml:"indexPrefix"`
	Version     string `json:"version" yaml:"version"`
}

func NewElasticSearchOptions

func NewElasticSearchOptions() *Options

func (*Options) AddFlags

func (s *Options) AddFlags(fs *pflag.FlagSet, c *Options)

func (*Options) ApplyTo

func (s *Options) ApplyTo(options *Options)

func (*Options) Validate

func (s *Options) Validate() []error

type Request

type Request struct {
	Index string
	Body  io.Reader
}

type Response

type Response struct {
	Hits         Hits                           `json:"hits"`
	Aggregations map[string]jsoniter.RawMessage `json:"aggregations"`
}

Jump to

Keyboard shortcuts

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