Documentation
¶
Index ¶
- type Elasticsearch
- func (es *Elasticsearch) Connect(url string, timeout time.Duration) error
- func (es *Elasticsearch) CreateIndexIfNotExists(ctx context.Context, esIndex string, esType string, mapping string) error
- func (es *Elasticsearch) GetClient() *elastic.Client
- func (es *Elasticsearch) Index(ctx context.Context, esIndex string, esType string, body interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Elasticsearch ¶
type Elasticsearch struct {
// contains filtered or unexported fields
}
Elasticsearch wrapper
func (*Elasticsearch) Connect ¶
func (es *Elasticsearch) Connect(url string, timeout time.Duration) error
Connect to the elastic search server
func (*Elasticsearch) CreateIndexIfNotExists ¶ added in v0.2.0
func (es *Elasticsearch) CreateIndexIfNotExists(ctx context.Context, esIndex string, esType string, mapping string) error
CreateIndexIfNotExists Creates an index if it doesn't already exists
func (*Elasticsearch) GetClient ¶
func (es *Elasticsearch) GetClient() *elastic.Client
GetClient returns the native elastic search client
Click to show internal directories.
Click to hide internal directories.