Documentation
¶
Index ¶
- type Client
- func (c *Client) BulkRetrieve(topic string, startOffset int64, limit int32) (*pb.BulkRetrieveResponse, error)
- func (c *Client) Close()
- func (c *Client) Consume(topic string, offset int64) ([]byte, int64, error)
- func (c *Client) ConsumeEarliest(topic string) ([]byte, int64, error)
- func (c *Client) ConsumeLatest(topic string) ([]byte, int64, error)
- func (c *Client) CreateTopic(topic string) error
- func (c *Client) DeleteUntilOffset(topic string, offset int64) error
- func (c *Client) Produce(topic string, message []byte) error
- func (c *Client) StreamConsume(topic string, startOffset int64, function func([]byte, int64) error) error
- func (c *Client) StreamProduce(topic string, function func() ([]byte, error)) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a struct that holds the connection to the server
func NewClient ¶
func NewClient(address, port string, tlsCfg *config.ClientTLSConfig) (*Client, error)
NewClient creates a new client It accepts an optional tlsCfg to enable mTLS. If tlsCfg is nil, it defaults to an insecure connection.
func (*Client) BulkRetrieve ¶ added in v1.0.2
func (c *Client) BulkRetrieve(topic string, startOffset int64, limit int32) (*pb.BulkRetrieveResponse, error)
BulkRetrieve retrieves a batch of messages from the server.
func (*Client) ConsumeEarliest ¶
func (*Client) CreateTopic ¶
CreateTopic creates a new topic on the server
func (*Client) DeleteUntilOffset ¶
DeleteUntilOffset deletes all messages in a topic until a certain offset
func (*Client) StreamConsume ¶
Click to show internal directories.
Click to hide internal directories.