rumour

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

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 NewClusterState

func NewClusterState() *ClusterState

NewClusterState inits a 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

type ConsumerOffset struct {
	Offset int64 `json:"offset"`
	Lag    int64 `json:"lag"`
}

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.

func (*Fetcher) RunLoop

func (f *Fetcher) RunLoop(ctx context.Context, state *State)

RunLoop starts the blocking loop.

type State

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

State maintains all state

func NewState

func NewState(clusters []string) *State

NewState inits a state.

func (*State) Cluster

func (s *State) Cluster(name string) *ClusterState

Cluster returns state by name.

func (*State) Clusters

func (s *State) Clusters() []string

Clusters returns the cluster names.

Jump to

Keyboard shortcuts

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