kafka

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Addrs    string
	Topic    string
	GroupId  string
	WarnTime time.Duration
}

type Consumer

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

func NewConsumer

func NewConsumer(ctx contextx.Context, opfs ...func(cfg *Config)) (*Consumer, error)

func (*Consumer) Cleanup

func (c *Consumer) Cleanup(assignment sarama.ConsumerGroupSession) error

func (*Consumer) ConsumeClaim

func (c *Consumer) ConsumeClaim(assignment sarama.ConsumerGroupSession, claim sarama.ConsumerGroupClaim) error

func (*Consumer) OnMessageHandler

func (c *Consumer) OnMessageHandler(f func(msg *pbf.QueueMsg))

func (*Consumer) Setup

func (c *Consumer) Setup(assignment sarama.ConsumerGroupSession) error

type Producer

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

func NewProducer

func NewProducer(g contextx.Context, opfs ...func(cfg *Config)) (*Producer, error)

func (*Producer) Push

func (p *Producer) Push(msg *pbf.QueueMsg) error

func (*Producer) PushProtoMsg

func (p *Producer) PushProtoMsg(msgId int32, arg interface{}, target *pbf.Target) error

Jump to

Keyboard shortcuts

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