kafka

package
v1.2.5 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2023 License: MIT Imports: 12 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetKafkaStats added in v1.2.3

func GetKafkaStats() (send uint64, received uint64)

func NewConsumerGroupHandler

func NewConsumerGroupHandler(queue *chan Message) 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 Message) (err error)

func (*Client) GetMessages

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

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 Message added in v1.2.0

type Message struct {
	Topic  string
	Value  []byte
	Header map[string][]byte
	Key    []byte
}

func ToKafkaMessage

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

type NewClientOptions

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

Jump to

Keyboard shortcuts

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