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(topic string) (Broker, error)
- func (m MockClient) GetOffset(topic string, partitionID int32, time int64) (int64, error)
- func (m MockClient) Leader(topic string, partition int32) (Broker, error)
- func (m MockClient) RefreshCoordinator(topic string) error
- type MockClusterAdmin
- func (c MockClusterAdmin) AlterConfig(resourceType sarama.ConfigResourceType, name string, ...) error
- func (c MockClusterAdmin) Close() error
- func (c MockClusterAdmin) CreateACL(resource sarama.Resource, acl sarama.Acl) error
- func (c MockClusterAdmin) CreatePartitions(topic string, count int32, assignment [][]int32, validateOnly bool) error
- func (c MockClusterAdmin) CreateTopic(topic string, detail *sarama.TopicDetail, validateOnly bool) error
- func (c MockClusterAdmin) DeleteACL(filter sarama.AclFilter, validateOnly bool) ([]sarama.MatchingAcl, error)
- func (c MockClusterAdmin) DeleteConsumerGroup(group string) error
- func (c MockClusterAdmin) DeleteRecords(topic string, partitionOffsets map[int32]int64) error
- func (c MockClusterAdmin) DeleteTopic(topic string) error
- func (c MockClusterAdmin) DescribeCluster() (brokers []*sarama.Broker, controllerID int32, err error)
- func (c MockClusterAdmin) DescribeConfig(resource sarama.ConfigResource) ([]sarama.ConfigEntry, error)
- func (c MockClusterAdmin) DescribeConsumerGroups(groups []string) ([]*sarama.GroupDescription, error)
- func (c MockClusterAdmin) DescribeTopics(topics []string) (metadata []*sarama.TopicMetadata, err error)
- func (c MockClusterAdmin) ListAcls(filter sarama.AclFilter) ([]sarama.ResourceAcls, error)
- func (c MockClusterAdmin) ListConsumerGroupOffsets(group string, topicPartitions map[string][]int32) (*sarama.OffsetFetchResponse, error)
- func (c MockClusterAdmin) ListConsumerGroups() (map[string]string, error)
- func (c MockClusterAdmin) ListTopics() (map[string]sarama.TopicDetail, 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 client
func (MockClient) Brokers ¶
func (m MockClient) Brokers() []Broker
Brokers is for implementing sarama.Client
func (MockClient) Coordinator ¶
func (m MockClient) Coordinator(topic string) (Broker, error)
Coordinator is for implementing sarama.Client
func (MockClient) Leader ¶
func (m MockClient) Leader(topic string, partition int32) (Broker, error)
Leader is for implementing sarama.Client
func (MockClient) RefreshCoordinator ¶
func (m MockClient) RefreshCoordinator(topic string) error
RefreshCoordinator is for implementing sarama.Client
type MockClusterAdmin ¶
MockClusterAdmin is a mockable sarama.ClusterAdmin
func (MockClusterAdmin) AlterConfig ¶
func (c MockClusterAdmin) AlterConfig(resourceType sarama.ConfigResourceType, name string, entries map[string]*string, validateOnly bool) error
AlterConfig is for implementing sarama.ClusterAdmin
func (MockClusterAdmin) Close ¶
func (c MockClusterAdmin) Close() error
Close is for implementing sarama.ClusterAdmin
func (MockClusterAdmin) CreatePartitions ¶
func (c MockClusterAdmin) CreatePartitions(topic string, count int32, assignment [][]int32, validateOnly bool) error
CreatePartitions is for implementing sarama.ClusterAdmin
func (MockClusterAdmin) CreateTopic ¶
func (c MockClusterAdmin) CreateTopic(topic string, detail *sarama.TopicDetail, validateOnly bool) error
CreateTopic is for implementing sarama.ClusterAdmin
func (MockClusterAdmin) DeleteACL ¶
func (c MockClusterAdmin) DeleteACL(filter sarama.AclFilter, validateOnly bool) ([]sarama.MatchingAcl, error)
DeleteACL is for implementing sarama.ClusterAdmin
func (MockClusterAdmin) DeleteConsumerGroup ¶
func (c MockClusterAdmin) DeleteConsumerGroup(group string) error
DeleteConsumerGroup is for implementing sarama.ClusterAdmin
func (MockClusterAdmin) DeleteRecords ¶
func (c MockClusterAdmin) DeleteRecords(topic string, partitionOffsets map[int32]int64) error
DeleteRecords is for implementing sarama.ClusterAdmin
func (MockClusterAdmin) DeleteTopic ¶
func (c MockClusterAdmin) DeleteTopic(topic string) error
DeleteTopic is for implementing sarama.ClusterAdmin
func (MockClusterAdmin) DescribeCluster ¶
func (c MockClusterAdmin) DescribeCluster() (brokers []*sarama.Broker, controllerID int32, err error)
DescribeCluster is for implementing sarama.ClusterAdmin
func (MockClusterAdmin) DescribeConfig ¶
func (c MockClusterAdmin) DescribeConfig(resource sarama.ConfigResource) ([]sarama.ConfigEntry, error)
DescribeConfig is for implementing sarama.ClusterAdmin
func (MockClusterAdmin) DescribeConsumerGroups ¶
func (c MockClusterAdmin) DescribeConsumerGroups(groups []string) ([]*sarama.GroupDescription, error)
DescribeConsumerGroups is for implementing sarama.ClusterAdmin
func (MockClusterAdmin) DescribeTopics ¶
func (c MockClusterAdmin) DescribeTopics(topics []string) (metadata []*sarama.TopicMetadata, err error)
DescribeTopics is for implementing sarama.ClusterAdmin
func (MockClusterAdmin) ListAcls ¶
func (c MockClusterAdmin) ListAcls(filter sarama.AclFilter) ([]sarama.ResourceAcls, error)
ListAcls is for implementing sarama.ClusterAdmin
func (MockClusterAdmin) ListConsumerGroupOffsets ¶
func (c MockClusterAdmin) ListConsumerGroupOffsets(group string, topicPartitions map[string][]int32) (*sarama.OffsetFetchResponse, error)
ListConsumerGroupOffsets is for implementing sarama.ClusterAdmin
func (MockClusterAdmin) ListConsumerGroups ¶
func (c MockClusterAdmin) ListConsumerGroups() (map[string]string, error)
ListConsumerGroups is for implementing sarama.ClusterAdmin
func (MockClusterAdmin) ListTopics ¶
func (c MockClusterAdmin) ListTopics() (map[string]sarama.TopicDetail, error)
ListTopics is for implementing sarama.ClusterAdmin
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