Documentation ¶
Overview ¶
Package zookeeper has a common interface and mock objects to implement and test Zookeeper connections.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetBrokerConnectionInfo ¶
func GetBrokerConnectionInfo(brokerID int, zkConn Connection) (scheme, brokerHost string, jmxPort int, brokerPort int, err error)
GetBrokerConnectionInfo Collects Broker connection info from Zookeeper
func GetBrokerIDs ¶
func GetBrokerIDs(zkConn Connection) ([]string, error)
GetBrokerIDs retrieves the broker ids from Zookeeper
Types ¶
type Connection ¶
type Connection interface { Get(string) ([]byte, *zk.Stat, error) Children(string) ([]string, *zk.Stat, error) CreateClient() (connection.Client, error) CreateClusterAdmin() (sarama.ClusterAdmin, error) }
Connection interface to allow easy mocking of a Zookeeper connection
func NewConnection ¶
func NewConnection(kafkaArgs *args.KafkaArguments) (Connection, error)
NewConnection creates a new Connection with the given arguments. If not hosts are specified then a nil Connection and error will be returned
Waiting on issue https://github.com/samuel/go-zookeeper/issues/108 so we can change this function and allow us to mock out the zk.Connect function
type MockConnection ¶
MockConnection implements Connection to facilitate testing.
func (MockConnection) CreateClient ¶
func (m MockConnection) CreateClient() (connection.Client, error)
CreateClient mocks the CreateClient method
func (MockConnection) CreateClusterAdmin ¶
func (m MockConnection) CreateClusterAdmin() (sarama.ClusterAdmin, error)
CreateClusterAdmin mocks the CreateClusterAdmin method