Documentation ¶
Overview ¶
Package kafka is a generated GoMock package.
Index ¶
- func DefaultClientConfig() *sarama.Config
- func DefaultListenerConfig() *sarama.Config
- func DefaultTopicBuilder(topic string) string
- func NewDefaultProducer(channel string, client *DefaultClient, enc EncodeMessageFunc) es.Producer
- type Client
- type ConsumerOption
- type ConsumerRequestFunc
- type DecodeMessageFunc
- type DefaultClient
- type DefaultConsumer
- type DefaultProducer
- func (p *DefaultProducer) Close() error
- func (p *DefaultProducer) Send(ctx context.Context, message interface{}) error
- func (p *DefaultProducer) SendMany(ctx context.Context, routeKey string, message []interface{}) error
- func (p *DefaultProducer) SendWithRouteKey(ctx context.Context, routeKey string, message interface{}) error
- type EncodeMessageFunc
- type ErrorFunc
- type Hook
- type Listener
- type ListenerOption
- type M
- type MessageFunc
- type MockClient
- type MockClientMockRecorder
- type TopicBuilder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultClientConfig ¶
func DefaultListenerConfig ¶
func DefaultTopicBuilder ¶
func NewDefaultProducer ¶
func NewDefaultProducer(channel string, client *DefaultClient, enc EncodeMessageFunc) es.Producer
Types ¶
type ConsumerOption ¶
type ConsumerOption func(*DefaultConsumer)
func ConsumerBefore ¶
func ConsumerBefore(before ...ConsumerRequestFunc) ConsumerOption
func ConsumerGroup ¶
func ConsumerGroup(group string) ConsumerOption
func ConsumerTopicBuilder ¶
func ConsumerTopicBuilder(tb TopicBuilder) ConsumerOption
type DecodeMessageFunc ¶
type DefaultClient ¶
type DefaultClient struct {
// contains filtered or unexported fields
}
func (*DefaultClient) Close ¶
func (c *DefaultClient) Close() (err error)
type DefaultConsumer ¶
type DefaultConsumer struct {
// contains filtered or unexported fields
}
func NewDefaultConsumer ¶
func NewDefaultConsumer( channel string, handler es.ConsumerHandler, dec DecodeMessageFunc, newListener func() Listener, options ...ConsumerOption, ) *DefaultConsumer
func (*DefaultConsumer) Close ¶
func (c *DefaultConsumer) Close() error
type DefaultProducer ¶
type DefaultProducer struct {
// contains filtered or unexported fields
}
func (*DefaultProducer) Close ¶
func (p *DefaultProducer) Close() error
func (*DefaultProducer) Send ¶
func (p *DefaultProducer) Send(ctx context.Context, message interface{}) error
func (*DefaultProducer) SendMany ¶
func (p *DefaultProducer) SendMany(ctx context.Context, routeKey string, message []interface{}) error
func (*DefaultProducer) SendWithRouteKey ¶
func (p *DefaultProducer) SendWithRouteKey(ctx context.Context, routeKey string, message interface{}) error
type EncodeMessageFunc ¶
type Listener ¶
type Listener interface { Listen(ctx context.Context, topic string, group string, fn MessageFunc) error Close() error }
func NewListener ¶
func NewListener(addr []string, conf *sarama.Config, options ...ListenerOption) Listener
type ListenerOption ¶
type ListenerOption func(l *listener)
func ListenerErrorHandler ¶
func ListenerErrorHandler(handler func(context.Context, error)) ListenerOption
func ListenerHooks ¶
func ListenerHooks(setup Hook, cleanup Hook) ListenerOption
type MockClient ¶
type MockClient struct {
// contains filtered or unexported fields
}
MockClient is a mock of Client interface
func NewMockClient ¶
func NewMockClient(ctrl *gomock.Controller) *MockClient
NewMockClient creates a new mock instance
func (*MockClient) EXPECT ¶
func (m *MockClient) EXPECT() *MockClientMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
type MockClientMockRecorder ¶
type MockClientMockRecorder struct {
// contains filtered or unexported fields
}
MockClientMockRecorder is the mock recorder for MockClient
func (*MockClientMockRecorder) Close ¶
func (mr *MockClientMockRecorder) Close() *gomock.Call
Close indicates an expected call of Close
func (*MockClientMockRecorder) Send ¶
func (mr *MockClientMockRecorder) Send(ctx, topic, routeKey, message interface{}) *gomock.Call
Send indicates an expected call of Send
type TopicBuilder ¶
Click to show internal directories.
Click to hide internal directories.