kafka

package
v0.0.0-...-f78e888 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2018 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 is simplified Kafka client to manage and inspect Kafka topic

func NewClient

func NewClient(bootstrapServers ...string) (*Client, error)

NewClient connects to the specified brokers. You should close the client after using it.

func (*Client) Close

func (g *Client) Close() error

Close close and cleanup the client

func (*Client) FetchData

func (g *Client) FetchData(topic string, part int32, offset int64, n int32, timeout time.Duration) ([]*sarama.ConsumerMessage, error)

FetchData fetches messages within specific offset range of single partition The main purpose of this function is to access to any single topic partition's data in random access manner.

func (*Client) ListGroups

func (g *Client) ListGroups() ([]*sarama.GroupDescription, error)

func (*Client) OffsetRange

func (g *Client) OffsetRange(topic string, part int32) (int64, int64, error)

OffsetRange returns min/max offset of the single partition

func (*Client) TopicInfos

func (g *Client) TopicInfos(topics ...string) ([]*sarama.TopicMetadata, error)

TopicInfos returns status and other useful informations of requested topics.

func (*Client) TopicNames

func (g *Client) TopicNames() ([]string, error)

TopicNames returns list of topic from the connected cluster

Jump to

Keyboard shortcuts

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