Documentation ¶
Index ¶
- Variables
- type ElasticSearchClient
- func (c *ElasticSearchClient) BulkDelete(obj string, id string)
- func (c *ElasticSearchClient) BulkIndex(obj string, id string, data interface{}) error
- func (c *ElasticSearchClient) BulkIndexChild(obj string, parent string, id string, data interface{}) 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) (elastigo.BaseResponse, error)
- func (c *ElasticSearchClient) FormatFilter(filter *filters.Filter, mapKey string) map[string]interface{}
- func (c *ElasticSearchClient) Get(obj string, id string) (elastigo.BaseResponse, error)
- func (c *ElasticSearchClient) Index(obj string, id string, data interface{}) error
- func (c *ElasticSearchClient) IndexChild(obj string, parent string, id string, data interface{}) error
- func (c *ElasticSearchClient) Search(obj string, query string) (elastigo.SearchResult, error)
- func (c *ElasticSearchClient) Start(mappings []map[string][]byte)
- 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
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 ElasticSearchClient ¶
type ElasticSearchClient struct {
// contains filtered or unexported fields
}
ElasticSearchClient describes a ElasticSearch client connection
func NewElasticSearchClient ¶
func NewElasticSearchClient(addr string, port string, maxConns int, retrySeconds int, bulkMaxDocs int, bulkMaxDelay int) (*ElasticSearchClient, error)
NewElasticSearchClient creates a new ElasticSearch client
func NewElasticSearchClientFromConfig ¶
func NewElasticSearchClientFromConfig() (*ElasticSearchClient, error)
NewElasticSearchClientFromConfig creates a new ElasticSearch client based on configuration
func (*ElasticSearchClient) BulkDelete ¶
func (c *ElasticSearchClient) BulkDelete(obj string, id string)
BulkDelete an object with the indexer
func (*ElasticSearchClient) BulkIndex ¶
func (c *ElasticSearchClient) BulkIndex(obj string, id string, data interface{}) error
BulkIndex returns the bulk index from the indexer
func (*ElasticSearchClient) BulkIndexChild ¶
func (c *ElasticSearchClient) BulkIndexChild(obj string, parent string, id string, data interface{}) error
BulkIndexChild index a while object with the indexer
func (*ElasticSearchClient) BulkUpdate ¶
func (c *ElasticSearchClient) BulkUpdate(obj string, id string, data interface{}) error
BulkUpdate and object with the indexer
func (*ElasticSearchClient) BulkUpdateWithPartialDoc ¶
func (c *ElasticSearchClient) BulkUpdateWithPartialDoc(obj string, id string, data interface{}) error
BulkUpdateWithPartialDoc an object with partial data using the indexer
func (*ElasticSearchClient) Delete ¶
func (c *ElasticSearchClient) Delete(obj string, id string) (elastigo.BaseResponse, error)
Delete an object
func (*ElasticSearchClient) FormatFilter ¶
func (c *ElasticSearchClient) FormatFilter(filter *filters.Filter, mapKey string) map[string]interface{}
FormatFilter creates a ElasticSearch request based on filters
func (*ElasticSearchClient) Get ¶
func (c *ElasticSearchClient) Get(obj string, id string) (elastigo.BaseResponse, error)
Get an object
func (*ElasticSearchClient) Index ¶
func (c *ElasticSearchClient) Index(obj string, id string, data interface{}) error
Index returns the skydive index
func (*ElasticSearchClient) IndexChild ¶
func (c *ElasticSearchClient) IndexChild(obj string, parent string, id string, data interface{}) error
IndexChild index a child object
func (*ElasticSearchClient) Search ¶
func (c *ElasticSearchClient) Search(obj string, query string) (elastigo.SearchResult, error)
Search an object
func (*ElasticSearchClient) Start ¶
func (c *ElasticSearchClient) Start(mappings []map[string][]byte)
Start the Elasticsearch client background jobs
func (*ElasticSearchClient) Started ¶
func (c *ElasticSearchClient) Started() bool
Started is the client already started ?
func (*ElasticSearchClient) Stop ¶
func (c *ElasticSearchClient) Stop()
Stop Elasticsearch background client
func (*ElasticSearchClient) Update ¶
func (c *ElasticSearchClient) Update(obj string, id string, data interface{}) error
Update an object
func (*ElasticSearchClient) UpdateWithPartialDoc ¶
func (c *ElasticSearchClient) UpdateWithPartialDoc(obj string, id string, data interface{}) error
UpdateWithPartialDoc an object with partial data
type ElasticSearchClientInterface ¶
type ElasticSearchClientInterface interface { FormatFilter(filter *filters.Filter, mapKey string) map[string]interface{} Index(obj string, id string, data interface{}) error BulkIndex(obj string, id string, data interface{}) error IndexChild(obj string, parent string, id string, data interface{}) error BulkIndexChild(obj string, parent string, id string, data interface{}) 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) (elastigo.BaseResponse, error) Delete(obj string, id string) (elastigo.BaseResponse, error) BulkDelete(obj string, id string) Search(obj string, query string) (elastigo.SearchResult, error) Start(mappings []map[string][]byte) }
ElasticSearchClientInterface describes the mechanism API of ElasticSearch database client