kf

package
v0.0.0-...-618fe63 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Database var
	Database kf = &Client{}
)

Functions

This section is empty.

Types

type Client

type Client struct {
	Config   *kafka.Conn
	Messages chan *sarama.ConsumerMessage
	Errors   chan *sarama.ConsumerError

	Count int
	// contains filtered or unexported fields
}

Client struct

func (*Client) Connect

func (k *Client) Connect(ctx context.Context, conf *conf.GlobalConfiguration, topic string, partition int) error

Connect is basic connection to kafka

func (*Client) Consumer

func (k *Client) Consumer(ctx context.Context, reader *kafka.Reader, action func(kafka.Message))

Consumer for a topic

func (*Client) NewReader

func (k *Client) NewReader(groupID, topic string, partition int) (*kafka.Reader, error)

NewReader func

func (*Client) TopicList

func (k *Client) TopicList() (map[string]struct{}, error)

TopicList get the list of topics for a broker

Jump to

Keyboard shortcuts

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