mocks

package
v0.0.0-...-aa78a79 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 5, 2018 License: MIT Imports: 3 Imported by: 0

Documentation

Index

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

func (c *Consumer) Close() error

Close mocks the #Close function of sarama-cluster Close. This closes all the channels for this mock.

func (*Consumer) CommitOffsets

func (c *Consumer) CommitOffsets() error

CommitOffsets mock is a no-op (currently)

func (*Consumer) CreateMockError

func (c *Consumer) CreateMockError() error

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

func (c *Consumer) Errors() <-chan error

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

func (c *Consumer) HighWaterMarks() map[string]map[int32]int64

HighWaterMarks mock is a no-op (currently)

func (*Consumer) IsClosed

func (c *Consumer) IsClosed() bool

IsClosed returns a bool specifying if the mock consumer is closed

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

func (c *Consumer) Subscriptions() map[string][]int32

Subscriptions mock is a no-op (currently)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL