Documentation ¶
Index ¶
- type Broker
- type Client
- type MockBroker
- func (b MockBroker) Close() error
- func (b MockBroker) Connected() (bool, error)
- func (b MockBroker) DescribeGroups(request *sarama.DescribeGroupsRequest) (*sarama.DescribeGroupsResponse, error)
- func (b MockBroker) Fetch(request *sarama.FetchRequest) (*sarama.FetchResponse, error)
- func (b MockBroker) FetchOffset(request *sarama.OffsetFetchRequest) (*sarama.OffsetFetchResponse, error)
- func (b MockBroker) ListGroups(request *sarama.ListGroupsRequest) (*sarama.ListGroupsResponse, error)
- func (b MockBroker) Open(config *sarama.Config) error
- type MockClient
- func (m MockClient) Brokers() []Broker
- func (m MockClient) Close() error
- func (m MockClient) Coordinator(groupID string) (Broker, error)
- func (m MockClient) GetOffset(topic string, partition int32, offset int64) (int64, error)
- func (m MockClient) Leader(topic string, partition int32) (Broker, error)
- func (m MockClient) Partitions(topic string) ([]int32, error)
- func (m MockClient) RefreshCoordinator(groupID string) error
- func (m MockClient) Topics() ([]string, error)
- type SaramaClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Broker ¶
type Broker interface { Connected() (bool, error) FetchOffset(*sarama.OffsetFetchRequest) (*sarama.OffsetFetchResponse, error) Fetch(*sarama.FetchRequest) (*sarama.FetchResponse, error) Open(*sarama.Config) error DescribeGroups(*sarama.DescribeGroupsRequest) (*sarama.DescribeGroupsResponse, error) ListGroups(*sarama.ListGroupsRequest) (*sarama.ListGroupsResponse, error) Close() error }
Broker is an interface for mocking
type Client ¶
type Client interface { Brokers() []Broker Topics() ([]string, error) Partitions(string) ([]int32, error) RefreshCoordinator(string) error Coordinator(string) (Broker, error) Leader(string, int32) (Broker, error) Close() error GetOffset(string, int32, int64) (int64, error) }
Client is an interface for mocking
type MockBroker ¶
MockBroker is a mock implementation of the Broker interface
func (MockBroker) Close ¶
func (b MockBroker) Close() error
Close is a mocked implementation of the sarama.Broker.Close() method
func (MockBroker) Connected ¶
func (b MockBroker) Connected() (bool, error)
Connected is a mocked implementation of the sarama.Broker.Connected() method
func (MockBroker) DescribeGroups ¶
func (b MockBroker) DescribeGroups(request *sarama.DescribeGroupsRequest) (*sarama.DescribeGroupsResponse, error)
DescribeGroups is a mocked implementation of the sarama.Broker.DescribeGroups() method
func (MockBroker) Fetch ¶
func (b MockBroker) Fetch(request *sarama.FetchRequest) (*sarama.FetchResponse, error)
Fetch is a mocked implementation of the sarama.Broker.Fetch() method
func (MockBroker) FetchOffset ¶
func (b MockBroker) FetchOffset(request *sarama.OffsetFetchRequest) (*sarama.OffsetFetchResponse, error)
FetchOffset is a mocked implementation of the sarama.Broker.FetchOffset() method
func (MockBroker) ListGroups ¶
func (b MockBroker) ListGroups(request *sarama.ListGroupsRequest) (*sarama.ListGroupsResponse, error)
ListGroups is a mocked implementation of the sarama.Broker.ListGroups() method
type MockClient ¶
MockClient is a mock implementation of the Client interface
func (MockClient) Brokers ¶
func (m MockClient) Brokers() []Broker
Brokers is a mocked implementation of the sarama.Client.Brokers() method
func (MockClient) Close ¶
func (m MockClient) Close() error
Close is a mocked implementation of the sarama.Client.Close() method
func (MockClient) Coordinator ¶
func (m MockClient) Coordinator(groupID string) (Broker, error)
Coordinator is a mocked implementation of the sarama.Client.Coordinator() method
func (MockClient) GetOffset ¶
GetOffset is a mocked implementation of the sarama.Client.GetOffset() method
func (MockClient) Leader ¶
func (m MockClient) Leader(topic string, partition int32) (Broker, error)
Leader is a mocked implementation of the sarama.Client.Leader() method
func (MockClient) Partitions ¶
func (m MockClient) Partitions(topic string) ([]int32, error)
Partitions is a mocked implementation of the sarama.Client.Partitions() method
func (MockClient) RefreshCoordinator ¶
func (m MockClient) RefreshCoordinator(groupID string) error
RefreshCoordinator is a mocked implementation of the sarama.Client.RefreshCoordinator() method
func (MockClient) Topics ¶
func (m MockClient) Topics() ([]string, error)
Topics is a mocked implementation of the sarama.Client.Topics() method
type SaramaClient ¶
SaramaClient is a wrapper struct for sarama.Client
func (SaramaClient) Brokers ¶
func (c SaramaClient) Brokers() []Broker
Brokers wraps the sarama Brokers function
func (SaramaClient) Coordinator ¶
func (c SaramaClient) Coordinator(groupID string) (Broker, error)
Coordinator wraps the sarama.Client.Coordinator() function