Documentation ¶
Overview ¶
Package messaging is a generated GoMock package.
Index ¶
- Variables
- type AckManager
- type Client
- type CloseableProducer
- type Consumer
- type Message
- type MetricProducerOptions
- type MetricsProducer
- type MockAckManager
- func (m *MockAckManager) AckItem(id int64) int64
- func (m *MockAckManager) EXPECT() *MockAckManagerMockRecorder
- func (m *MockAckManager) GetAckLevel() int64
- func (m *MockAckManager) GetBacklogCount() int64
- func (m *MockAckManager) GetReadLevel() int64
- func (m *MockAckManager) ReadItem(id int64) error
- func (m *MockAckManager) SetAckLevel(ackLevel int64)
- func (m *MockAckManager) SetReadLevel(readLevel int64)
- type MockAckManagerMockRecorder
- func (mr *MockAckManagerMockRecorder) AckItem(id interface{}) *gomock.Call
- func (mr *MockAckManagerMockRecorder) GetAckLevel() *gomock.Call
- func (mr *MockAckManagerMockRecorder) GetBacklogCount() *gomock.Call
- func (mr *MockAckManagerMockRecorder) GetReadLevel() *gomock.Call
- func (mr *MockAckManagerMockRecorder) ReadItem(id interface{}) *gomock.Call
- func (mr *MockAckManagerMockRecorder) SetAckLevel(ackLevel interface{}) *gomock.Call
- func (mr *MockAckManagerMockRecorder) SetReadLevel(readLevel interface{}) *gomock.Call
- type MockClient
- type MockClientMockRecorder
- type MockCloseableProducer
- type MockCloseableProducerMockRecorder
- type MockConsumer
- type MockConsumerMockRecorder
- type MockMessage
- type MockMessageMockRecorder
- type MockProducer
- type MockProducerMockRecorder
- type Producer
Constants ¶
This section is empty.
Variables ¶
var ( // ErrMessageSizeLimit indicate that message is rejected by server due to size limitation ErrMessageSizeLimit = errors.New("message was too large, server rejected it to avoid allocation error") )
Functions ¶
This section is empty.
Types ¶
type AckManager ¶ added in v0.18.0
type AckManager interface { // Read an item into backlog for processing for ack ReadItem(id int64) error // Get current max ID from read items GetReadLevel() int64 // Set current max ID from read items SetReadLevel(readLevel int64) // Mark an item as done processing, and remove from backlog AckItem(id int64) (ackLevel int64) // Get current max level that can safely ack GetAckLevel() int64 // Set current max level that can safely ack SetAckLevel(ackLevel int64) // GetBacklogCount return the of items that are waiting for ack GetBacklogCount() int64 }
AckManager convert out of order acks into ackLevel movement.
func NewAckManager ¶ added in v0.18.0
func NewAckManager(logger log.Logger) AckManager
NewAckManager returns a AckManager without monitoring the itemIDs continousness. For example, our internal matching task queue doesn't guarantee it.
func NewContinuousAckManager ¶ added in v0.18.0
func NewContinuousAckManager(logger log.Logger) AckManager
NewContinuousAckManager returns a ContinuousAckManager it will emit error logs for itemIDs being incontinuous This is useful for some message queue system that guarantees continuousness that we want to monitor it's behaving correctly
type Client ¶
type Client interface { NewConsumer(appName, consumerName string) (Consumer, error) NewProducer(appName string) (Producer, error) }
Client is the interface used to abstract out interaction with messaging system for replication
type CloseableProducer ¶ added in v0.9.3
CloseableProducer is a Producer that can be closed
type Consumer ¶ added in v0.4.0
type Consumer interface { // Start starts the consumer Start() error // Stop stops the consumer Stop() // Messages return the message channel for this consumer Messages() <-chan Message }
Consumer is the unified interface for both internal and external kafka clients
type Message ¶ added in v0.4.0
type Message interface { // Value is a mutable reference to the message's value Value() []byte // Partition is the ID of the partition from which the message was read. Partition() int32 // Offset is the message's offset. Offset() int64 // Ack marks the message as successfully processed. Ack() error // Nack marks the message processing as failed and the message will be retried or sent to DLQ. Nack() error }
Message is the unified interface for a Kafka message
type MetricProducerOptions ¶ added in v1.2.13
type MetricProducerOptions func(*MetricsProducer)
func WithMetricTags ¶ added in v1.2.13
func WithMetricTags(tags ...metrics.Tag) MetricProducerOptions
type MetricsProducer ¶ added in v1.2.13
type MetricsProducer struct {
// contains filtered or unexported fields
}
func (*MetricsProducer) Close ¶ added in v1.2.13
func (p *MetricsProducer) Close() error
type MockAckManager ¶ added in v1.2.11
type MockAckManager struct {
// contains filtered or unexported fields
}
MockAckManager is a mock of AckManager interface.
func NewMockAckManager ¶ added in v1.2.11
func NewMockAckManager(ctrl *gomock.Controller) *MockAckManager
NewMockAckManager creates a new mock instance.
func (*MockAckManager) AckItem ¶ added in v1.2.11
func (m *MockAckManager) AckItem(id int64) int64
AckItem mocks base method.
func (*MockAckManager) EXPECT ¶ added in v1.2.11
func (m *MockAckManager) EXPECT() *MockAckManagerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockAckManager) GetAckLevel ¶ added in v1.2.11
func (m *MockAckManager) GetAckLevel() int64
GetAckLevel mocks base method.
func (*MockAckManager) GetBacklogCount ¶ added in v1.2.11
func (m *MockAckManager) GetBacklogCount() int64
GetBacklogCount mocks base method.
func (*MockAckManager) GetReadLevel ¶ added in v1.2.11
func (m *MockAckManager) GetReadLevel() int64
GetReadLevel mocks base method.
func (*MockAckManager) ReadItem ¶ added in v1.2.11
func (m *MockAckManager) ReadItem(id int64) error
ReadItem mocks base method.
func (*MockAckManager) SetAckLevel ¶ added in v1.2.11
func (m *MockAckManager) SetAckLevel(ackLevel int64)
SetAckLevel mocks base method.
func (*MockAckManager) SetReadLevel ¶ added in v1.2.11
func (m *MockAckManager) SetReadLevel(readLevel int64)
SetReadLevel mocks base method.
type MockAckManagerMockRecorder ¶ added in v1.2.11
type MockAckManagerMockRecorder struct {
// contains filtered or unexported fields
}
MockAckManagerMockRecorder is the mock recorder for MockAckManager.
func (*MockAckManagerMockRecorder) AckItem ¶ added in v1.2.11
func (mr *MockAckManagerMockRecorder) AckItem(id interface{}) *gomock.Call
AckItem indicates an expected call of AckItem.
func (*MockAckManagerMockRecorder) GetAckLevel ¶ added in v1.2.11
func (mr *MockAckManagerMockRecorder) GetAckLevel() *gomock.Call
GetAckLevel indicates an expected call of GetAckLevel.
func (*MockAckManagerMockRecorder) GetBacklogCount ¶ added in v1.2.11
func (mr *MockAckManagerMockRecorder) GetBacklogCount() *gomock.Call
GetBacklogCount indicates an expected call of GetBacklogCount.
func (*MockAckManagerMockRecorder) GetReadLevel ¶ added in v1.2.11
func (mr *MockAckManagerMockRecorder) GetReadLevel() *gomock.Call
GetReadLevel indicates an expected call of GetReadLevel.
func (*MockAckManagerMockRecorder) ReadItem ¶ added in v1.2.11
func (mr *MockAckManagerMockRecorder) ReadItem(id interface{}) *gomock.Call
ReadItem indicates an expected call of ReadItem.
func (*MockAckManagerMockRecorder) SetAckLevel ¶ added in v1.2.11
func (mr *MockAckManagerMockRecorder) SetAckLevel(ackLevel interface{}) *gomock.Call
SetAckLevel indicates an expected call of SetAckLevel.
func (*MockAckManagerMockRecorder) SetReadLevel ¶ added in v1.2.11
func (mr *MockAckManagerMockRecorder) SetReadLevel(readLevel interface{}) *gomock.Call
SetReadLevel indicates an expected call of SetReadLevel.
type MockClient ¶ added in v1.2.11
type MockClient struct {
// contains filtered or unexported fields
}
MockClient is a mock of Client interface.
func NewMockClient ¶ added in v1.2.11
func NewMockClient(ctrl *gomock.Controller) *MockClient
NewMockClient creates a new mock instance.
func (*MockClient) EXPECT ¶ added in v1.2.11
func (m *MockClient) EXPECT() *MockClientMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockClient) NewConsumer ¶ added in v1.2.11
func (m *MockClient) NewConsumer(appName, consumerName string) (Consumer, error)
NewConsumer mocks base method.
func (*MockClient) NewProducer ¶ added in v1.2.11
func (m *MockClient) NewProducer(appName string) (Producer, error)
NewProducer mocks base method.
type MockClientMockRecorder ¶ added in v1.2.11
type MockClientMockRecorder struct {
// contains filtered or unexported fields
}
MockClientMockRecorder is the mock recorder for MockClient.
func (*MockClientMockRecorder) NewConsumer ¶ added in v1.2.11
func (mr *MockClientMockRecorder) NewConsumer(appName, consumerName interface{}) *gomock.Call
NewConsumer indicates an expected call of NewConsumer.
func (*MockClientMockRecorder) NewProducer ¶ added in v1.2.11
func (mr *MockClientMockRecorder) NewProducer(appName interface{}) *gomock.Call
NewProducer indicates an expected call of NewProducer.
type MockCloseableProducer ¶ added in v1.2.11
type MockCloseableProducer struct {
// contains filtered or unexported fields
}
MockCloseableProducer is a mock of CloseableProducer interface.
func NewMockCloseableProducer ¶ added in v1.2.11
func NewMockCloseableProducer(ctrl *gomock.Controller) *MockCloseableProducer
NewMockCloseableProducer creates a new mock instance.
func (*MockCloseableProducer) Close ¶ added in v1.2.11
func (m *MockCloseableProducer) Close() error
Close mocks base method.
func (*MockCloseableProducer) EXPECT ¶ added in v1.2.11
func (m *MockCloseableProducer) EXPECT() *MockCloseableProducerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockCloseableProducerMockRecorder ¶ added in v1.2.11
type MockCloseableProducerMockRecorder struct {
// contains filtered or unexported fields
}
MockCloseableProducerMockRecorder is the mock recorder for MockCloseableProducer.
func (*MockCloseableProducerMockRecorder) Close ¶ added in v1.2.11
func (mr *MockCloseableProducerMockRecorder) Close() *gomock.Call
Close indicates an expected call of Close.
func (*MockCloseableProducerMockRecorder) Publish ¶ added in v1.2.11
func (mr *MockCloseableProducerMockRecorder) Publish(ctx, message interface{}) *gomock.Call
Publish indicates an expected call of Publish.
type MockConsumer ¶ added in v1.2.11
type MockConsumer struct {
// contains filtered or unexported fields
}
MockConsumer is a mock of Consumer interface.
func NewMockConsumer ¶ added in v1.2.11
func NewMockConsumer(ctrl *gomock.Controller) *MockConsumer
NewMockConsumer creates a new mock instance.
func (*MockConsumer) EXPECT ¶ added in v1.2.11
func (m *MockConsumer) EXPECT() *MockConsumerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockConsumer) Messages ¶ added in v1.2.11
func (m *MockConsumer) Messages() <-chan Message
Messages mocks base method.
func (*MockConsumer) Start ¶ added in v1.2.11
func (m *MockConsumer) Start() error
Start mocks base method.
type MockConsumerMockRecorder ¶ added in v1.2.11
type MockConsumerMockRecorder struct {
// contains filtered or unexported fields
}
MockConsumerMockRecorder is the mock recorder for MockConsumer.
func (*MockConsumerMockRecorder) Messages ¶ added in v1.2.11
func (mr *MockConsumerMockRecorder) Messages() *gomock.Call
Messages indicates an expected call of Messages.
func (*MockConsumerMockRecorder) Start ¶ added in v1.2.11
func (mr *MockConsumerMockRecorder) Start() *gomock.Call
Start indicates an expected call of Start.
func (*MockConsumerMockRecorder) Stop ¶ added in v1.2.11
func (mr *MockConsumerMockRecorder) Stop() *gomock.Call
Stop indicates an expected call of Stop.
type MockMessage ¶ added in v1.2.11
type MockMessage struct {
// contains filtered or unexported fields
}
MockMessage is a mock of Message interface.
func NewMockMessage ¶ added in v1.2.11
func NewMockMessage(ctrl *gomock.Controller) *MockMessage
NewMockMessage creates a new mock instance.
func (*MockMessage) EXPECT ¶ added in v1.2.11
func (m *MockMessage) EXPECT() *MockMessageMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockMessage) Nack ¶ added in v1.2.11
func (m *MockMessage) Nack() error
Nack mocks base method.
func (*MockMessage) Offset ¶ added in v1.2.11
func (m *MockMessage) Offset() int64
Offset mocks base method.
func (*MockMessage) Partition ¶ added in v1.2.11
func (m *MockMessage) Partition() int32
Partition mocks base method.
func (*MockMessage) Value ¶ added in v1.2.11
func (m *MockMessage) Value() []byte
Value mocks base method.
type MockMessageMockRecorder ¶ added in v1.2.11
type MockMessageMockRecorder struct {
// contains filtered or unexported fields
}
MockMessageMockRecorder is the mock recorder for MockMessage.
func (*MockMessageMockRecorder) Ack ¶ added in v1.2.11
func (mr *MockMessageMockRecorder) Ack() *gomock.Call
Ack indicates an expected call of Ack.
func (*MockMessageMockRecorder) Nack ¶ added in v1.2.11
func (mr *MockMessageMockRecorder) Nack() *gomock.Call
Nack indicates an expected call of Nack.
func (*MockMessageMockRecorder) Offset ¶ added in v1.2.11
func (mr *MockMessageMockRecorder) Offset() *gomock.Call
Offset indicates an expected call of Offset.
func (*MockMessageMockRecorder) Partition ¶ added in v1.2.11
func (mr *MockMessageMockRecorder) Partition() *gomock.Call
Partition indicates an expected call of Partition.
func (*MockMessageMockRecorder) Value ¶ added in v1.2.11
func (mr *MockMessageMockRecorder) Value() *gomock.Call
Value indicates an expected call of Value.
type MockProducer ¶ added in v1.2.11
type MockProducer struct {
// contains filtered or unexported fields
}
MockProducer is a mock of Producer interface.
func NewMockProducer ¶ added in v1.2.11
func NewMockProducer(ctrl *gomock.Controller) *MockProducer
NewMockProducer creates a new mock instance.
func (*MockProducer) EXPECT ¶ added in v1.2.11
func (m *MockProducer) EXPECT() *MockProducerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockProducerMockRecorder ¶ added in v1.2.11
type MockProducerMockRecorder struct {
// contains filtered or unexported fields
}
MockProducerMockRecorder is the mock recorder for MockProducer.
func (*MockProducerMockRecorder) Publish ¶ added in v1.2.11
func (mr *MockProducerMockRecorder) Publish(ctx, message interface{}) *gomock.Call
Publish indicates an expected call of Publish.
type Producer ¶
Producer is the interface used to send replication tasks to other clusters through replicator
func NewMetricProducer ¶ added in v0.5.0
func NewMetricProducer( producer Producer, metricsClient metrics.Client, opts ...MetricProducerOptions, ) Producer
NewMetricProducer creates a new instance of producer that emits metrics
func NewNoopProducer ¶ added in v0.15.0
func NewNoopProducer() Producer
NewNoopProducer returns a no-op message producer