client changes
This commit is contained in:
parent
68414597e6
commit
2f9392955b
|
@ -0,0 +1,5 @@
|
|||
all:
|
||||
go build -o elasticstream cmd/main.go
|
||||
|
||||
clean:
|
||||
rm -f elasticstream
|
11
client.go
11
client.go
|
@ -1,6 +1,8 @@
|
|||
package elasticstream
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/elastic/go-elasticsearch/v8"
|
||||
)
|
||||
|
||||
|
@ -41,8 +43,13 @@ func (c *Client) Open() error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func (c *Client) Read() (Data, error) {
|
||||
return Data{}, nil
|
||||
func (c *Client) Read() (*Data, error) {
|
||||
|
||||
data, ok := <-c.ch
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("error reading data from channel")
|
||||
}
|
||||
return &data, nil
|
||||
}
|
||||
|
||||
// func (c *Client) Ack(ctx context.Context, position int) error {
|
||||
|
|
Loading…
Reference in New Issue