kafka

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2023 License: MIT Imports: 10 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConsumerGroupHandler

func NewConsumerGroupHandler(queue *chan KafkaMessage) sarama.ConsumerGroupHandler

Types

type Client

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

func NewKafkaClient

func NewKafkaClient(opts NewClientOptions) (client *Client, err error)

func (*Client) ChangeSubscribedTopics

func (c *Client) ChangeSubscribedTopics(newTopicRegex *regexp.Regexp)

func (*Client) Close

func (c *Client) Close() error

func (*Client) EnqueueMessage

func (c *Client) EnqueueMessage(msg KafkaMessage) (err error)

func (*Client) GSub

func (c *Client) GSub(ctx context.Context, cncl context.CancelFunc)

func (*Client) GetMessages

func (c *Client) GetMessages() <-chan KafkaMessage

func (*Client) Ready

func (c *Client) Ready() bool

type ConsumerGroupHandler

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

func (ConsumerGroupHandler) Cleanup

func (ConsumerGroupHandler) ConsumeClaim

func (ConsumerGroupHandler) Setup

type KafkaMessage

type KafkaMessage struct {
	Topic string
	Value []byte
}

func ToKafkaMessage

func ToKafkaMessage(topic string, message interface{}) (KafkaMessage, error)

type NewClientOptions

type NewClientOptions struct {
	Brokers           []string
	ConsumerName      string
	ListenTopicRegex  *regexp.Regexp
	Partitions        int32
	ReplicationFactor int16
}

Jump to

Keyboard shortcuts

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