kafkadriver

package
v0.0.0-...-c63310e Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client handles the subscriptions to Kafka topics

func NewClient

func NewClient(
	ctx context.Context,
	brokers []string,
	groupID string,
	config *sarama.Config,
	opts ...Option,
) (*Client, error)

NewClient constructor creates the client using the specified config sarama is used internally to connect to kafka brokers brokers is a slice of broker addresses config is a sarama.Config struct groupID is consumer group id

func (*Client) Close

func (client *Client) Close(ctx context.Context) error

Close is just a placeholder

func (*Client) Subscribe

func (client *Client) Subscribe(ctx context.Context, topic string) (*pubsub.Subscription, error)

Subscribe method subscribes to the kafka topic

type Option

type Option func(*Client) error

Option is a self-refrential function for configuration

Jump to

Keyboard shortcuts

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