Documentation
¶
Index ¶
- Variables
- type Config
- type ElasticIndex
- type ElasticSearchClient
- func (c *ElasticSearchClient) BulkDelete(obj string, id string)
- func (c *ElasticSearchClient) BulkIndex(obj string, id string, data interface{}) (bool, error)
- func (c *ElasticSearchClient) BulkIndexChild(obj string, parent string, id string, data interface{}) (bool, error)
- func (c *ElasticSearchClient) BulkUpdate(obj string, id string, data interface{}) error
- func (c *ElasticSearchClient) BulkUpdateWithPartialDoc(obj string, id string, data interface{}) error
- func (c *ElasticSearchClient) Delete(obj string, id string) (*elastic.DeleteResponse, error)
- func (c *ElasticSearchClient) FormatFilter(filter *filters.Filter, mapKey string) elastic.Query
- func (c *ElasticSearchClient) Get(obj string, id string) (*elastic.GetResult, error)
- func (c *ElasticSearchClient) GetClient() *elastic.Client
- func (c *ElasticSearchClient) GetIndexAlias() string
- func (c *ElasticSearchClient) GetIndexAllAlias() string
- func (c *ElasticSearchClient) Index(obj string, id string, data interface{}) (bool, error)
- func (c *ElasticSearchClient) IndexChild(obj string, parent string, id string, data interface{}) (bool, error)
- func (c *ElasticSearchClient) IndexPath() string
- func (c *ElasticSearchClient) RollIndex() error
- func (c *ElasticSearchClient) Search(obj string, query elastic.Query, index string, opts filters.SearchQuery) (*elastic.SearchResult, error)
- func (c *ElasticSearchClient) ShouldRollIndex() bool
- func (c *ElasticSearchClient) Start()
- func (c *ElasticSearchClient) Started() bool
- func (c *ElasticSearchClient) Stop()
- func (c *ElasticSearchClient) Update(obj string, id string, data interface{}) error
- func (c *ElasticSearchClient) UpdateWithPartialDoc(obj string, id string, data interface{}) error
- type ElasticSearchClientInterface
- type Mappings
Constants ¶
This section is empty.
Variables ¶
var ErrBadConfig = errors.New("elasticsearch : Config file is misconfigured, check elasticsearch key format")
ErrBadConfig error bad configuration file
Functions ¶
This section is empty.
Types ¶
type Config ¶ added in v0.18.0
type Config struct {
ElasticHost string
MaxConns int
RetrySeconds int
BulkMaxDocs int
BulkMaxDelay int
EntriesLimit int
AgeLimit int
IndicesLimit int
}
Config describes configuration for elasticsearch
type ElasticIndex ¶ added in v0.18.0
ElasticIndex describes an ElasticSearch index and its current status
type ElasticSearchClient ¶ added in v0.9.0
type ElasticSearchClient struct {
// contains filtered or unexported fields
}
ElasticSearchClient describes a ElasticSearch client connection
func NewElasticSearchClient ¶ added in v0.9.0
func NewElasticSearchClient(name string, mappings Mappings, cfg Config) (*ElasticSearchClient, error)
NewElasticSearchClient creates a new ElasticSearch client based on configuration
func (*ElasticSearchClient) BulkDelete ¶ added in v0.16.0
func (c *ElasticSearchClient) BulkDelete(obj string, id string)
BulkDelete an object with the indexer
func (*ElasticSearchClient) BulkIndex ¶ added in v0.16.0
func (c *ElasticSearchClient) BulkIndex(obj string, id string, data interface{}) (bool, error)
BulkIndex returns the bulk index from the indexer
func (*ElasticSearchClient) BulkIndexChild ¶ added in v0.16.0
func (c *ElasticSearchClient) BulkIndexChild(obj string, parent string, id string, data interface{}) (bool, error)
BulkIndexChild index a while object with the indexer
func (*ElasticSearchClient) BulkUpdate ¶ added in v0.16.0
func (c *ElasticSearchClient) BulkUpdate(obj string, id string, data interface{}) error
BulkUpdate and object with the indexer
func (*ElasticSearchClient) BulkUpdateWithPartialDoc ¶ added in v0.16.0
func (c *ElasticSearchClient) BulkUpdateWithPartialDoc(obj string, id string, data interface{}) error
BulkUpdateWithPartialDoc an object with partial data using the indexer
func (*ElasticSearchClient) Delete ¶ added in v0.9.0
func (c *ElasticSearchClient) Delete(obj string, id string) (*elastic.DeleteResponse, error)
Delete an object
func (*ElasticSearchClient) FormatFilter ¶ added in v0.16.0
FormatFilter creates a ElasticSearch request based on filters
func (*ElasticSearchClient) Get ¶ added in v0.9.0
Get an object
func (*ElasticSearchClient) GetClient ¶ added in v0.18.0
func (c *ElasticSearchClient) GetClient() *elastic.Client
GetClient returns the elastic client object
func (*ElasticSearchClient) GetIndexAlias ¶ added in v0.18.0
func (c *ElasticSearchClient) GetIndexAlias() string
Get the rolling alias which points to the currently active index
func (*ElasticSearchClient) GetIndexAllAlias ¶ added in v0.18.0
func (c *ElasticSearchClient) GetIndexAllAlias() string
Get the alias which points to all Skydive indices
func (*ElasticSearchClient) Index ¶ added in v0.9.0
func (c *ElasticSearchClient) Index(obj string, id string, data interface{}) (bool, error)
Index returns the skydive index
func (*ElasticSearchClient) IndexChild ¶ added in v0.9.0
func (c *ElasticSearchClient) IndexChild(obj string, parent string, id string, data interface{}) (bool, error)
IndexChild index a child object
func (*ElasticSearchClient) IndexPath ¶ added in v0.18.0
func (c *ElasticSearchClient) IndexPath() string
func (*ElasticSearchClient) RollIndex ¶ added in v0.18.0
func (c *ElasticSearchClient) RollIndex() error
Roll the current elasticsearch index
func (*ElasticSearchClient) Search ¶ added in v0.9.0
func (c *ElasticSearchClient) Search(obj string, query elastic.Query, index string, opts filters.SearchQuery) (*elastic.SearchResult, error)
Search an object
func (*ElasticSearchClient) ShouldRollIndex ¶ added in v0.18.0
func (c *ElasticSearchClient) ShouldRollIndex() bool
func (*ElasticSearchClient) Start ¶ added in v0.9.0
func (c *ElasticSearchClient) Start()
Start the Elasticsearch client background jobs
func (*ElasticSearchClient) Started ¶ added in v0.9.0
func (c *ElasticSearchClient) Started() bool
Started is the client already started ?
func (*ElasticSearchClient) Stop ¶ added in v0.9.0
func (c *ElasticSearchClient) Stop()
Stop Elasticsearch background client
func (*ElasticSearchClient) Update ¶ added in v0.9.0
func (c *ElasticSearchClient) Update(obj string, id string, data interface{}) error
Update an object
func (*ElasticSearchClient) UpdateWithPartialDoc ¶ added in v0.9.0
func (c *ElasticSearchClient) UpdateWithPartialDoc(obj string, id string, data interface{}) error
UpdateWithPartialDoc an object with partial data
type ElasticSearchClientInterface ¶ added in v0.16.0
type ElasticSearchClientInterface interface {
FormatFilter(filter *filters.Filter, mapKey string) elastic.Query
RollIndex() error
Index(obj string, id string, data interface{}) (bool, error)
BulkIndex(obj string, id string, data interface{}) (bool, error)
IndexChild(obj string, parent string, id string, data interface{}) (bool, error)
BulkIndexChild(obj string, parent string, id string, data interface{}) (bool, error)
Update(obj string, id string, data interface{}) error
BulkUpdate(obj string, id string, data interface{}) error
UpdateWithPartialDoc(obj string, id string, data interface{}) error
BulkUpdateWithPartialDoc(obj string, id string, data interface{}) error
Get(obj string, id string) (*elastic.GetResult, error)
Delete(obj string, id string) (*elastic.DeleteResponse, error)
BulkDelete(obj string, id string)
Search(obj string, query elastic.Query, index string, pagination filters.SearchQuery) (*elastic.SearchResult, error)
Start()
GetIndexAlias() string
GetIndexAllAlias() string
}
ElasticSearchClientInterface describes the mechanism API of ElasticSearch database client
Source Files
¶
- client.go