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
|
package elasticstream
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
"github.com/elastic/go-elasticsearch/v8"
|
"github.com/elastic/go-elasticsearch/v8"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -41,8 +43,13 @@ func (c *Client) Open() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) Read() (Data, error) {
|
func (c *Client) Read() (*Data, error) {
|
||||||
return Data{}, nil
|
|
||||||
|
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 {
|
// func (c *Client) Ack(ctx context.Context, position int) error {
|
||||||
|
|
Loading…
Reference in New Issue