client

package
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 29, 2017 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithAddresses

func WithAddresses(addrs ...string) optionFn

func WithGRPCClientConn added in v0.1.1

func WithGRPCClientConn(conn *grpc.ClientConn) optionFn

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(opts ...optionFn) (c *Client, err error)

func (*Client) Close

func (c *Client) Close() error

func (*Client) CreateTopic

func (c *Client) CreateTopic(ctx context.Context, params *sgproto.CreateTopicParams) error

func (*Client) ListPartitions

func (c *Client) ListPartitions(ctx context.Context, topic string) ([]string, error)

func (*Client) NewConsumer

func (c *Client) NewConsumer(topic, partition, group, name string) *Consumer

func (*Client) ProduceMessage

func (c *Client) ProduceMessage(ctx context.Context, msg *sgproto.Message) error

func (*Client) ProduceMessageCh

func (c *Client) ProduceMessageCh(ctx context.Context) (chan<- *sgproto.Message, <-chan error)

type Consumer

type Consumer struct {
	// contains filtered or unexported fields
}

func (*Consumer) Acknowledge

func (c *Consumer) Acknowledge(ctx context.Context, msg *sgproto.Message) error

func (*Consumer) AcknowledgeMessages

func (c *Consumer) AcknowledgeMessages(ctx context.Context, offsets []sandflake.ID) error

func (*Consumer) Commit

func (c *Consumer) Commit(ctx context.Context, msg *sgproto.Message) error

func (*Consumer) Consume

func (c *Consumer) Consume(ctx context.Context) (chan *sgproto.Message, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL