Documentation ¶
Overview ¶
Package eventbus is a generated GoMock package.
Package eventbus is a generated GoMock package.
Package eventbus is a generated GoMock package.
Index ¶
- func ChannelBuilder(st stream.Type) string
- func Filter(events ...stream.EventType) func(stream.EventType) bool
- type Bus
- type Duplicator
- type Envelope
- type Error
- type Handler
- type HandlerCollector
- type HandlerFunc
- type HandlerMetrics
- type HandlerMiddleware
- type Logging
- type MockDuplicator
- type MockDuplicatorMockRecorder
- type MockHandler
- type MockHandlerMockRecorder
- type MockPublisher
- type MockPublisherMockRecorder
- type MockSubscriber
- func (m *MockSubscriber) Close() error
- func (m *MockSubscriber) EXPECT() *MockSubscriberMockRecorder
- func (m *MockSubscriber) Listen(arg0 context.Context) error
- func (m *MockSubscriber) Subscribe(ctx context.Context, st stream.Type, h ...Handler) error
- func (m *MockSubscriber) Subscriptions() []string
- func (m *MockSubscriber) Unsubscribe(ctx context.Context, st ...stream.Type) error
- type MockSubscriberMockRecorder
- func (mr *MockSubscriberMockRecorder) Close() *gomock.Call
- func (mr *MockSubscriberMockRecorder) Listen(arg0 interface{}) *gomock.Call
- func (mr *MockSubscriberMockRecorder) Subscribe(ctx, st interface{}, h ...interface{}) *gomock.Call
- func (mr *MockSubscriberMockRecorder) Subscriptions() *gomock.Call
- func (mr *MockSubscriberMockRecorder) Unsubscribe(ctx interface{}, st ...interface{}) *gomock.Call
- type Option
- type Publisher
- type PublisherCollector
- type PublisherMetrics
- type PublisherMiddleware
- type PublisherOption
- type Subscriber
- type SubscriberOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChannelBuilder ¶
Types ¶
type Bus ¶
type Bus interface { Subscriber Publisher }
type Duplicator ¶
type Duplicator interface { Has(context.Context, stream.Event) bool Ensure(context.Context, stream.Event) error }
func NewNopDuplicator ¶
func NewNopDuplicator() Duplicator
type Envelope ¶
type Envelope struct {
// contains filtered or unexported fields
}
func NewEnvelope ¶
type Error ¶
type HandlerCollector ¶
type HandlerCollector struct {
// contains filtered or unexported fields
}
func (*HandlerCollector) HandleEvent ¶
func (*HandlerCollector) MatchEvent ¶
type HandlerMetrics ¶
type HandlerMiddleware ¶
func NewHandlerCollector ¶
func NewHandlerCollector(m *HandlerMetrics) HandlerMiddleware
func NewLogging ¶
func NewLogging(logger log.Logger) HandlerMiddleware
func WrapHandler ¶
func WrapHandler(em HandlerMiddleware, ems ...HandlerMiddleware) HandlerMiddleware
type Logging ¶
type Logging struct {
// contains filtered or unexported fields
}
func (*Logging) HandleEvent ¶
type MockDuplicator ¶
type MockDuplicator struct {
// contains filtered or unexported fields
}
MockDuplicator is a mock of Duplicator interface
func NewMockDuplicator ¶
func NewMockDuplicator(ctrl *gomock.Controller) *MockDuplicator
NewMockDuplicator creates a new mock instance
func (*MockDuplicator) EXPECT ¶
func (m *MockDuplicator) EXPECT() *MockDuplicatorMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
type MockDuplicatorMockRecorder ¶
type MockDuplicatorMockRecorder struct {
// contains filtered or unexported fields
}
MockDuplicatorMockRecorder is the mock recorder for MockDuplicator
func (*MockDuplicatorMockRecorder) Ensure ¶
func (mr *MockDuplicatorMockRecorder) Ensure(arg0, arg1 interface{}) *gomock.Call
Ensure indicates an expected call of Ensure
func (*MockDuplicatorMockRecorder) Has ¶
func (mr *MockDuplicatorMockRecorder) Has(arg0, arg1 interface{}) *gomock.Call
Has indicates an expected call of Has
type MockHandler ¶
type MockHandler struct {
// contains filtered or unexported fields
}
MockHandler is a mock of Handler interface
func NewMockHandler ¶
func NewMockHandler(ctrl *gomock.Controller) *MockHandler
NewMockHandler creates a new mock instance
func (*MockHandler) EXPECT ¶
func (m *MockHandler) EXPECT() *MockHandlerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockHandler) HandleEvent ¶
HandleEvent mocks base method
func (*MockHandler) MatchEvent ¶
MatchEvent mocks base method
type MockHandlerMockRecorder ¶
type MockHandlerMockRecorder struct {
// contains filtered or unexported fields
}
MockHandlerMockRecorder is the mock recorder for MockHandler
func (*MockHandlerMockRecorder) HandleEvent ¶
func (mr *MockHandlerMockRecorder) HandleEvent(arg0, arg1 interface{}) *gomock.Call
HandleEvent indicates an expected call of HandleEvent
func (*MockHandlerMockRecorder) MatchEvent ¶
func (mr *MockHandlerMockRecorder) MatchEvent(arg0, arg1 interface{}) *gomock.Call
MatchEvent indicates an expected call of MatchEvent
type MockPublisher ¶
type MockPublisher struct {
// contains filtered or unexported fields
}
MockPublisher is a mock of Publisher interface
func NewMockPublisher ¶
func NewMockPublisher(ctrl *gomock.Controller) *MockPublisher
NewMockPublisher creates a new mock instance
func (*MockPublisher) EXPECT ¶
func (m *MockPublisher) EXPECT() *MockPublisherMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
type MockPublisherMockRecorder ¶
type MockPublisherMockRecorder struct {
// contains filtered or unexported fields
}
MockPublisherMockRecorder is the mock recorder for MockPublisher
func (*MockPublisherMockRecorder) Close ¶
func (mr *MockPublisherMockRecorder) Close() *gomock.Call
Close indicates an expected call of Close
func (*MockPublisherMockRecorder) Publish ¶
func (mr *MockPublisherMockRecorder) Publish(arg0, arg1 interface{}) *gomock.Call
Publish indicates an expected call of Publish
type MockSubscriber ¶
type MockSubscriber struct {
// contains filtered or unexported fields
}
MockSubscriber is a mock of Subscriber interface
func NewMockSubscriber ¶
func NewMockSubscriber(ctrl *gomock.Controller) *MockSubscriber
NewMockSubscriber creates a new mock instance
func (*MockSubscriber) EXPECT ¶
func (m *MockSubscriber) EXPECT() *MockSubscriberMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockSubscriber) Listen ¶
func (m *MockSubscriber) Listen(arg0 context.Context) error
Listen mocks base method
func (*MockSubscriber) Subscriptions ¶
func (m *MockSubscriber) Subscriptions() []string
Subscriptions mocks base method
func (*MockSubscriber) Unsubscribe ¶
Unsubscribe mocks base method
type MockSubscriberMockRecorder ¶
type MockSubscriberMockRecorder struct {
// contains filtered or unexported fields
}
MockSubscriberMockRecorder is the mock recorder for MockSubscriber
func (*MockSubscriberMockRecorder) Close ¶
func (mr *MockSubscriberMockRecorder) Close() *gomock.Call
Close indicates an expected call of Close
func (*MockSubscriberMockRecorder) Listen ¶
func (mr *MockSubscriberMockRecorder) Listen(arg0 interface{}) *gomock.Call
Listen indicates an expected call of Listen
func (*MockSubscriberMockRecorder) Subscribe ¶
func (mr *MockSubscriberMockRecorder) Subscribe(ctx, st interface{}, h ...interface{}) *gomock.Call
Subscribe indicates an expected call of Subscribe
func (*MockSubscriberMockRecorder) Subscriptions ¶
func (mr *MockSubscriberMockRecorder) Subscriptions() *gomock.Call
Subscriptions indicates an expected call of Subscriptions
func (*MockSubscriberMockRecorder) Unsubscribe ¶
func (mr *MockSubscriberMockRecorder) Unsubscribe(ctx interface{}, st ...interface{}) *gomock.Call
Unsubscribe indicates an expected call of Unsubscribe
type Option ¶
type Option func(*bus)
func WithHandlerMiddleware ¶
func WithHandlerMiddleware(m ...HandlerMiddleware) Option
func WithPublisherMiddleware ¶
func WithPublisherMiddleware(m ...PublisherMiddleware) Option
type Publisher ¶
func NewPublisher ¶
func NewPublisher( s messaging.Sender, e *Envelope, o ...PublisherOption, ) Publisher
type PublisherCollector ¶
type PublisherCollector struct {
// contains filtered or unexported fields
}
func (*PublisherCollector) Close ¶
func (c *PublisherCollector) Close() error
type PublisherMetrics ¶
type PublisherMiddleware ¶
func NewPublisherCollector ¶
func NewPublisherCollector(m *PublisherMetrics) PublisherMiddleware
func WrapPublisher ¶
func WrapPublisher(em PublisherMiddleware, ems ...PublisherMiddleware) PublisherMiddleware
type PublisherOption ¶
type PublisherOption func(*publisher)
func PublisherChannelBuilder ¶
func PublisherChannelBuilder(cb messaging.ChannelBuilderFunc) PublisherOption
type Subscriber ¶
type Subscriber interface { Subscriptions() []string Subscribe(ctx context.Context, st stream.Type, h ...Handler) error Unsubscribe(ctx context.Context, st ...stream.Type) error Listen(context.Context) error Close() error }
func NewSubscriber ¶
func NewSubscriber( r messaging.Receiver, e *Envelope, o ...SubscriberOption, ) Subscriber
type SubscriberOption ¶
type SubscriberOption func(*subscriber)
func SubscriberChannelBuilder ¶
func SubscriberChannelBuilder(cb messaging.ChannelBuilderFunc) SubscriberOption
func SubscriberDuplicator ¶
func SubscriberDuplicator(i Duplicator) SubscriberOption
func SubscriberErrorHandler ¶
func SubscriberErrorHandler(h messaging.ErrorHandler) SubscriberOption