Documentation ¶
Index ¶
- type AsyncProducer
- func (a *AsyncProducer) AsyncClose()
- func (a *AsyncProducer) Close() error
- func (a *AsyncProducer) CreateMockError(topic string, key string, value string) *sarama.ProducerError
- func (a *AsyncProducer) CreateMockMessage(topic string, key string, value string) *sarama.ProducerMessage
- func (a *AsyncProducer) Errors() <-chan *sarama.ProducerError
- func (a *AsyncProducer) Input() chan<- *sarama.ProducerMessage
- func (a *AsyncProducer) IsClosed() bool
- func (a *AsyncProducer) Successes() <-chan *sarama.ProducerMessage
- type Consumer
- func (c *Consumer) Close() error
- func (c *Consumer) CommitOffsets() error
- func (c *Consumer) CreateMockError() error
- func (c *Consumer) CreateMockMessage(topic string, key string, value string) *sarama.ConsumerMessage
- func (c *Consumer) CreateMockNotification() *cluster.Notification
- func (c *Consumer) Errors() <-chan error
- func (c *Consumer) HighWaterMarks() map[string]map[int32]int64
- func (c *Consumer) IsClosed() bool
- func (c *Consumer) MarkOffset(msg *sarama.ConsumerMessage, metadata string)
- func (c *Consumer) MarkOffsets(s *cluster.OffsetStash)
- func (c *Consumer) MarkPartitionOffset(topic string, partition int32, offset int64, metadata string)
- func (c *Consumer) Messages() <-chan *sarama.ConsumerMessage
- func (c *Consumer) Notifications() <-chan *cluster.Notification
- func (c *Consumer) Partitions() <-chan cluster.PartitionConsumer
- func (c *Consumer) ResetOffset(msg *sarama.ConsumerMessage, metadata string)
- func (c *Consumer) ResetOffsets(s *cluster.OffsetStash)
- func (c *Consumer) ResetPartitionOffset(topic string, partition int32, offset int64, metadata string)
- func (c *Consumer) Subscriptions() map[string][]int32
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AsyncProducer ¶
type AsyncProducer struct { ErrorsChan chan *sarama.ProducerError InputChan chan *sarama.ProducerMessage SuccessesChan chan *sarama.ProducerMessage // contains filtered or unexported fields }
AsyncProducer defines a mock async-producer. It provides writeable channels to mock various message-types.
func (*AsyncProducer) AsyncClose ¶
func (a *AsyncProducer) AsyncClose()
AsyncClose mocks the #AsyncClose function of sarama AsyncProducer
func (*AsyncProducer) Close ¶
func (a *AsyncProducer) Close() error
Close mocks the #Close function of sarama AsyncProducer. This closes all the channels for this mock.
func (*AsyncProducer) CreateMockError ¶
func (a *AsyncProducer) CreateMockError(topic string, key string, value string) *sarama.ProducerError
CreateMockError creates a mock producer error
func (*AsyncProducer) CreateMockMessage ¶
func (a *AsyncProducer) CreateMockMessage(topic string, key string, value string) *sarama.ProducerMessage
CreateMockMessage creates a mock producer message
func (*AsyncProducer) Errors ¶
func (a *AsyncProducer) Errors() <-chan *sarama.ProducerError
Errors mocks the #Errors function of sarama AsyncProducer. Returns a read-only error channel. The errors can be mocked by writing to ErrorsChan var of this struct.
func (*AsyncProducer) Input ¶
func (a *AsyncProducer) Input() chan<- *sarama.ProducerMessage
Input mocks the #Input function of sarama AsyncProducer. Returns a write-only input channel. The inputs can be mocked by reading from InputChan var of this struct.
func (*AsyncProducer) IsClosed ¶
func (a *AsyncProducer) IsClosed() bool
IsClosed returns a bool specifying if the mock producer is closed
func (*AsyncProducer) Successes ¶
func (a *AsyncProducer) Successes() <-chan *sarama.ProducerMessage
Successes mocks the #Successes function of sarama AsyncProducer. Returns a read-only successes channel. The successes can be mocked by writing to SuccessesChan var of this struct.
type Consumer ¶
type Consumer struct { ErrorsChan chan error MessagesChan chan *sarama.ConsumerMessage NotificationsChan chan *cluster.Notification PartitionsChan chan cluster.PartitionConsumer // contains filtered or unexported fields }
Consumer defines a mock consumer. It provides writeable channels to mock various message-types.
func (*Consumer) Close ¶
Close mocks the #Close function of sarama-cluster Close. This closes all the channels for this mock.
func (*Consumer) CommitOffsets ¶
CommitOffsets mock is a no-op (currently)
func (*Consumer) CreateMockError ¶
CreateMockError creates a mock consumer error
func (*Consumer) CreateMockMessage ¶
func (c *Consumer) CreateMockMessage(topic string, key string, value string) *sarama.ConsumerMessage
CreateMockMessage creates a mock consumer error
func (*Consumer) CreateMockNotification ¶
func (c *Consumer) CreateMockNotification() *cluster.Notification
CreateMockNotification creates a mock consumer error
func (*Consumer) Errors ¶
Errors mocks the #Errors function of sarama-cluster Consumer. Returns a read-only error channel. The errors can be mocked by writing to ErrorsChan var of this struct.
func (*Consumer) HighWaterMarks ¶
HighWaterMarks mock is a no-op (currently)
func (*Consumer) MarkOffset ¶
func (c *Consumer) MarkOffset(msg *sarama.ConsumerMessage, metadata string)
MarkOffset mock is a no-op (currently)
func (*Consumer) MarkOffsets ¶
func (c *Consumer) MarkOffsets(s *cluster.OffsetStash)
MarkOffsets mock is a no-op (currently)
func (*Consumer) MarkPartitionOffset ¶
func (c *Consumer) MarkPartitionOffset(topic string, partition int32, offset int64, metadata string)
MarkPartitionOffset mock is a no-op (currently)
func (*Consumer) Messages ¶
func (c *Consumer) Messages() <-chan *sarama.ConsumerMessage
Messages mocks the #Messages function of sarama-cluster Consumer. Returns a read-only messages channel. The messages can be mocked by writing to MessagesChan var of this struct.
func (*Consumer) Notifications ¶
func (c *Consumer) Notifications() <-chan *cluster.Notification
Notifications mocks the #Messages function of sarama-cluster Consumer. Returns a read-only notifications channel. The notifications can be mocked by writing to NotificationsChan var of this struct.
func (*Consumer) Partitions ¶
func (c *Consumer) Partitions() <-chan cluster.PartitionConsumer
Partitions mocks the #Partitions function of sarama-cluster Consumer. Returns a read-only partitions channel. The messages can be mocked by writing to PartitionsChan var of this struct.
func (*Consumer) ResetOffset ¶
func (c *Consumer) ResetOffset(msg *sarama.ConsumerMessage, metadata string)
ResetOffset mock is a no-op (currently)
func (*Consumer) ResetOffsets ¶
func (c *Consumer) ResetOffsets(s *cluster.OffsetStash)
ResetOffsets mock is a no-op (currently)
func (*Consumer) ResetPartitionOffset ¶
func (c *Consumer) ResetPartitionOffset(topic string, partition int32, offset int64, metadata string)
ResetPartitionOffset mock is a no-op (currently)
func (*Consumer) Subscriptions ¶
Subscriptions mock is a no-op (currently)