Documentation ¶
Index ¶
- type BrokerConnection
- type BrokerMetadata
- type BrokerStatus
- type ClusterStatus
- type HealthCheck
- type HealthCheckConfig
- type MockBrokerConnection
- func (_m *MockBrokerConnection) Close()
- func (_m *MockBrokerConnection) Consumer(conf kafka.ConsumerConf) (kafka.Consumer, error)
- func (_m *MockBrokerConnection) Dial(nodeAddresses []string, conf kafka.BrokerConf) error
- func (_m *MockBrokerConnection) EXPECT() *_MockBrokerConnectionRecorder
- func (_m *MockBrokerConnection) Metadata() (*proto.MetadataResp, error)
- func (_m *MockBrokerConnection) Producer(conf kafka.ProducerConf) kafka.Producer
- type MockZkConnection
- func (_m *MockZkConnection) Children(path string) ([]string, *zk.Stat, error)
- func (_m *MockZkConnection) Close()
- func (_m *MockZkConnection) Connect(servers []string, sessionTimeout time.Duration) (<-chan zk.Event, error)
- func (_m *MockZkConnection) Create(path string, data []byte, flags int32, acl []zk.ACL) (string, error)
- func (_m *MockZkConnection) EXPECT() *_MockZkConnectionRecorder
- func (_m *MockZkConnection) Exists(path string) (bool, *zk.Stat, error)
- func (_m *MockZkConnection) Get(path string) ([]byte, *zk.Stat, error)
- func (_m *MockZkConnection) Set(path string, data []byte, version int32) (*zk.Stat, error)
- type PartitionStatus
- type ReplicationStatus
- type StatusReport
- type TopicStatus
- type Update
- type ZkConnection
- type ZkTopic
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BrokerConnection ¶
type BrokerConnection interface { Dial(nodeAddresses []string, conf kafka.Config) error Consumer(conf kafka.Config) (kafka.Consumer, error) Producer(conf kafka.Config) kafka.SyncProducer Metadata() (*kafka.MetadataResponse, error) Close() }
BrokerConnection represents a connection to the Kafka broker
type BrokerMetadata ¶
type BrokerStatus ¶
type BrokerStatus struct { Status string `json:"status"` OutOfSync []ReplicationStatus `json:"out-of-sync,omitempty"` ReplicationFailures uint `json:"replication-failures,omitempty"` }
func (BrokerStatus) Json ¶
func (s BrokerStatus) Json() (data []byte, err error)
func (BrokerStatus) Summary ¶
func (s BrokerStatus) Summary() string
type ClusterStatus ¶
type ClusterStatus struct { Status string `json:"status"` Topics []TopicStatus `json:"topics,omitempty"` Metadata []BrokerMetadata `json:"metadata,omitempty"` ZooKeeper string `json:"zookeeper-connection,omitempty"` }
func (ClusterStatus) Json ¶
func (s ClusterStatus) Json() (data []byte, err error)
func (ClusterStatus) Summary ¶
func (s ClusterStatus) Summary() string
type HealthCheck ¶
type HealthCheck struct {
// contains filtered or unexported fields
}
HealthCheck holds all data required for health checking.
func New ¶
func New(config HealthCheckConfig) *HealthCheck
New creates a new health check with the given config.
func (*HealthCheck) CheckHealth ¶
func (check *HealthCheck) CheckHealth(brokerUpdates chan<- Update, clusterUpdates chan<- Update, stop <-chan struct{})
CheckHealth checks broker and cluster health.
func (*HealthCheck) ParseCommandLineArguments ¶
func (check *HealthCheck) ParseCommandLineArguments()
ParseCommandLineArguments parses the command line arguments.
func (*HealthCheck) ServeHealth ¶
func (check *HealthCheck) ServeHealth(brokerUpdates <-chan Update, clusterUpdates <-chan Update, stop <-chan struct{})
ServeHealth answers http queries for broker and cluster health.
type HealthCheckConfig ¶
type HealthCheckConfig struct { MessageLength int CheckInterval time.Duration CheckTimeout time.Duration DataWaitInterval time.Duration NoTopicCreation bool // contains filtered or unexported fields }
HealthCheckConfig is the configuration for the health check.
type MockBrokerConnection ¶
type MockBrokerConnection struct {
// contains filtered or unexported fields
}
Mock of BrokerConnection interface
func NewMockBrokerConnection ¶
func NewMockBrokerConnection(ctrl *gomock.Controller) *MockBrokerConnection
func (*MockBrokerConnection) Close ¶
func (_m *MockBrokerConnection) Close()
func (*MockBrokerConnection) Consumer ¶
func (_m *MockBrokerConnection) Consumer(conf kafka.ConsumerConf) (kafka.Consumer, error)
func (*MockBrokerConnection) Dial ¶
func (_m *MockBrokerConnection) Dial(nodeAddresses []string, conf kafka.BrokerConf) error
func (*MockBrokerConnection) EXPECT ¶
func (_m *MockBrokerConnection) EXPECT() *_MockBrokerConnectionRecorder
func (*MockBrokerConnection) Metadata ¶
func (_m *MockBrokerConnection) Metadata() (*proto.MetadataResp, error)
func (*MockBrokerConnection) Producer ¶
func (_m *MockBrokerConnection) Producer(conf kafka.ProducerConf) kafka.Producer
type MockZkConnection ¶
type MockZkConnection struct {
// contains filtered or unexported fields
}
Mock of ZkConnection interface
func NewMockZkConnection ¶
func NewMockZkConnection(ctrl *gomock.Controller) *MockZkConnection
func (*MockZkConnection) Close ¶
func (_m *MockZkConnection) Close()
func (*MockZkConnection) EXPECT ¶
func (_m *MockZkConnection) EXPECT() *_MockZkConnectionRecorder
type PartitionStatus ¶
type ReplicationStatus ¶
type StatusReport ¶
type TopicStatus ¶
type TopicStatus struct { Topic string `json:"topic"` Status string `json:"status"` ZooKeeper string `json:"zookeeper,omitempty"` Partitions map[string]PartitionStatus `json:"partitions,omitempty"` }
type ZkConnection ¶
type ZkConnection interface { Connect(servers []string, sessionTimeout time.Duration) (<-chan zk.Event, error) Close() Exists(path string) (bool, *zk.Stat, error) Set(path string, data []byte, version int32) (*zk.Stat, error) Create(path string, data []byte, flags int32, acl []zk.ACL) (string, error) Children(path string) ([]string, *zk.Stat, error) Get(path string) ([]byte, *zk.Stat, error) }
ZkConnection represents a connection to a ZooKeeper ensemble
Click to show internal directories.
Click to hide internal directories.