Documentation ¶
Index ¶
- func WithAddresses(addrs ...string) optionFn
- func WithGRPCClientConn(conn *grpc.ClientConn) optionFn
- func WithProducerBatchSize(batchSize int) func(*ProducerConfig)
- func WithProducerFlushInterval(interval time.Duration) func(*ProducerConfig)
- func WithProducerPartition(partition string) func(*ProducerConfig)
- type AsyncProducer
- type Client
- func (c *Client) Close() error
- func (c *Client) CreateTopic(ctx context.Context, params *sgproto.TopicConfig) error
- func (c *Client) ListPartitions(ctx context.Context, topic string) ([]string, error)
- func (c *Client) NewConsumer(topic, partition, group, name string) *Consumer
- func (c *Client) ProduceMessage(ctx context.Context, topic, partition string, msg *sgproto.Message) error
- type Consumer
- type Handler
- type HandlerFunc
- type Mux
- type MuxManager
- type Producer
- type ProducerConfig
- type ProducerMessage
- type ProducerOption
- type SyncProducer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithAddresses ¶
func WithAddresses(addrs ...string) optionFn
func WithGRPCClientConn ¶
func WithGRPCClientConn(conn *grpc.ClientConn) optionFn
func WithProducerBatchSize ¶
func WithProducerBatchSize(batchSize int) func(*ProducerConfig)
func WithProducerFlushInterval ¶
func WithProducerFlushInterval(interval time.Duration) func(*ProducerConfig)
func WithProducerPartition ¶
func WithProducerPartition(partition string) func(*ProducerConfig)
Types ¶
type AsyncProducer ¶
type AsyncProducer struct {
// contains filtered or unexported fields
}
func NewAsyncProducer ¶
func NewAsyncProducer(client *Client, topic, partition string, opts ...ProducerOption) *AsyncProducer
func (*AsyncProducer) Close ¶
func (p *AsyncProducer) Close() error
func (*AsyncProducer) Produce ¶
func (p *AsyncProducer) Produce(ctx context.Context, msg *ProducerMessage) error
func (*AsyncProducer) ProduceMessages ¶
func (p *AsyncProducer) ProduceMessages(ctx context.Context, msgs []*ProducerMessage) error
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) CreateTopic ¶
func (*Client) ListPartitions ¶
func (*Client) NewConsumer ¶
type Consumer ¶
type Consumer struct {
// contains filtered or unexported fields
}
func (*Consumer) Acknowledge ¶
type HandlerFunc ¶
type MuxManager ¶
type MuxManager struct { Mux *Mux Client *Client ConsumerGroup string ConsumerName string SynchronousCompution bool ReFetchSleepDuration time.Duration // contains filtered or unexported fields }
func (*MuxManager) Start ¶
func (m *MuxManager) Start() error
type Producer ¶
type Producer interface { Produce(ctx context.Context, msg *ProducerMessage) error ProduceMessages(ctx context.Context, msgs []*ProducerMessage) error Close() error }
type ProducerConfig ¶
type ProducerConfig struct {
// contains filtered or unexported fields
}
type ProducerMessage ¶
type ProducerOption ¶
type ProducerOption func(*ProducerConfig)
type SyncProducer ¶
type SyncProducer struct {
// contains filtered or unexported fields
}
func NewSyncProducer ¶
func NewSyncProducer(client *Client, topic string, opts ...ProducerOption) *SyncProducer
func (*SyncProducer) Close ¶
func (p *SyncProducer) Close() error
func (*SyncProducer) Produce ¶
func (p *SyncProducer) Produce(ctx context.Context, msg *ProducerMessage) error
func (*SyncProducer) ProduceMessages ¶
func (p *SyncProducer) ProduceMessages(ctx context.Context, msgs []*ProducerMessage) error
Click to show internal directories.
Click to hide internal directories.