123456789101112131415161718192021222324 |
- package services
- import (
- "github.com/elastic/go-elasticsearch/v7"
- )
- func NewEsV7Client() (client *elasticsearch.Client, err error) {
- conf := elasticsearch.Config{
- Addresses: []string{ES_URL},
- Username: ES_USERNAME,
- Password: ES_PASSWORD,
- }
- client, err = elasticsearch.NewClient(conf)
- return
- }
|