Documentation ¶
Index ¶
- Constants
- type ErrInvalidParam
- type PartitionMetadata
- type PartitionOffset
- type T
- func (a *T) GetAllTopicConsumers(topic string) (map[string]map[string][]int32, error)
- func (a *T) GetGroupOffsets(group, topic string) ([]PartitionOffset, error)
- func (a *T) GetTopicConsumers(group, topic string) (map[string][]int32, error)
- func (a *T) GetTopicMetadata(topic string, withPartitions, withConfig bool) (TopicMetadata, error)
- func (a *T) ListTopics(withPartitions, withConfig bool) ([]TopicMetadata, error)
- func (a *T) ResetKafkaClt()
- func (a *T) SetGroupOffsets(group, topic string, offsets []PartitionOffset) error
- func (a *T) Stop()
- type TopicConfig
- type TopicMetadata
Constants ¶
const (
ProtocolVer1 = 1 // Supported by Kafka v0.8.2 and later
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrInvalidParam ¶
type ErrInvalidParam error
type PartitionMetadata ¶ added in v0.14.0
type PartitionOffset ¶
type T ¶
type T struct {
// contains filtered or unexported fields
}
T provides methods to perform administrative operations on a Kafka cluster.
func Spawn ¶
Spawn creates an admin instance with the specified configuration and starts internal goroutines to support its operation.
func (*T) GetAllTopicConsumers ¶
GetAllTopicConsumers returns group -> client-id -> consumed-partitions-list mapping for a particular topic. Warning, the function performs scan of all consumer groups registered in ZooKeeper and therefore can take a lot of time.
func (*T) GetGroupOffsets ¶
func (a *T) GetGroupOffsets(group, topic string) ([]PartitionOffset, error)
GetGroupOffsets for every partition of the specified topic it returns the current offset range along with the latest offset and metadata committed by the specified consumer group.
func (*T) GetTopicConsumers ¶
GetTopicConsumers returns client-id -> consumed-partitions-list mapping for a clients from a particular consumer group and a particular topic.
func (*T) GetTopicMetadata ¶ added in v0.14.0
func (a *T) GetTopicMetadata(topic string, withPartitions, withConfig bool) (TopicMetadata, error)
GetTopicMetadata returns a topic metadata. An optional partition metadata can be requested and/or detailed topic configuration can be requested.
func (*T) ListTopics ¶ added in v0.14.0
func (a *T) ListTopics(withPartitions, withConfig bool) ([]TopicMetadata, error)
ListTopics returns a list of all topics existing in the Kafka cluster.
func (*T) ResetKafkaClt ¶ added in v0.14.0
func (a *T) ResetKafkaClt()
func (*T) SetGroupOffsets ¶
func (a *T) SetGroupOffsets(group, topic string, offsets []PartitionOffset) error
SetGroupOffsets commits specific offset values along with metadata for a list of partitions of a particular topic on behalf of the specified group.
type TopicConfig ¶ added in v0.14.0
type TopicMetadata ¶ added in v0.14.0
type TopicMetadata struct { Topic string Config *TopicConfig Partitions []PartitionMetadata }