Documentation ¶
Index ¶
- type ClusterConfig
- type ClusterState
- func (s *ClusterState) Brokers() []string
- func (s *ClusterState) ConsumerGroups() []string
- func (s *ClusterState) ConsumerTopics(group string) ([]ConsumerTopic, bool)
- func (s *ClusterState) ExpireConsumerGroups(timestamp int64)
- func (s *ClusterState) TopicOffsets(topic string) ([]int64, bool)
- func (s *ClusterState) Topics() []string
- func (s *ClusterState) UpdateBrokers(brokers []string)
- func (s *ClusterState) UpdateConsumerOffsets(group, topic string, timestamp int64, offsets []int64)
- func (s *ClusterState) UpdateTopic(name string, offsets []int64)
- type ConsumerOffset
- type ConsumerTopic
- type Fetcher
- type State
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClusterConfig ¶
type ClusterConfig struct { Name string `ignored:"true"` Brokers []string `required:"true"` MetaRefresh time.Duration `default:"180s"` OffsetRefresh time.Duration `default:"30s"` }
ClusterConfig contains cluster config info.
type ClusterState ¶
type ClusterState struct {
// contains filtered or unexported fields
}
ClusterState maintains cluster state.
func (*ClusterState) Brokers ¶
func (s *ClusterState) Brokers() []string
Brokers returns the broker addresses.
func (*ClusterState) ConsumerGroups ¶
func (s *ClusterState) ConsumerGroups() []string
ConsumerGroups returns consumer group names.
func (*ClusterState) ConsumerTopics ¶
func (s *ClusterState) ConsumerTopics(group string) ([]ConsumerTopic, bool)
ConsumerTopics returns a summary of ConsumerTopics.
func (*ClusterState) ExpireConsumerGroups ¶ added in v0.2.4
func (s *ClusterState) ExpireConsumerGroups(timestamp int64)
ExpireConsumerGroups removes consumer groups that have not updated since timestamp.
func (*ClusterState) TopicOffsets ¶
func (s *ClusterState) TopicOffsets(topic string) ([]int64, bool)
TopicOffsets returns offsets for a topic.
func (*ClusterState) Topics ¶
func (s *ClusterState) Topics() []string
Topics returns the topic names.
func (*ClusterState) UpdateBrokers ¶
func (s *ClusterState) UpdateBrokers(brokers []string)
UpdateBrokers updates brokers addresses.
func (*ClusterState) UpdateConsumerOffsets ¶
func (s *ClusterState) UpdateConsumerOffsets(group, topic string, timestamp int64, offsets []int64)
UpdateConsumerOffsets updates consumer offsets.
func (*ClusterState) UpdateTopic ¶
func (s *ClusterState) UpdateTopic(name string, offsets []int64)
UpdateTopic updates topic offsets.
type ConsumerOffset ¶
ConsumerOffset maintains partition offsets for a consumer.
type ConsumerTopic ¶
type ConsumerTopic struct { Topic string `json:"topic"` Timestamp int64 `json:"timestamp"` Offsets []ConsumerOffset `json:"offsets"` }
ConsumerTopic maintains group topic info.
type Fetcher ¶
type Fetcher struct {
// contains filtered or unexported fields
}
Fetcher updates state.
func NewFetcher ¶
func NewFetcher(clusters ...ClusterConfig) (*Fetcher, error)
NewFetcher inits a fetcher.