elasticstream/source/elastic/client.go

25 lines
395 B
Go
Raw Normal View History

2024-10-07 15:25:13 +05:30
package elastic
import (
2024-10-07 16:26:41 +05:30
"elasticstream/config"
"elasticstream/opencdc"
2024-10-07 15:25:13 +05:30
"github.com/boltdb/bolt"
"github.com/elastic/go-elasticsearch/v8"
)
type Client struct {
2024-10-07 16:26:41 +05:30
cfg *config.Config
es *elasticsearch.Client
db *bolt.DB
offsets map[string]int
ch chan opencdc.Data
2024-10-07 15:25:13 +05:30
}
2024-10-07 16:26:41 +05:30
func NewClient() *Client {
2024-10-07 15:25:13 +05:30
client := &Client{
offsets: make(map[string]int),
}
return client
}