Documentation ¶
Overview ¶
Package commandbus is a generated GoMock package.
Package commandbus is a generated GoMock package.
Package commandbus is a generated GoMock package.
Package commandbus is a generated GoMock package.
Index ¶
- Constants
- Variables
- func ChannelBuilder(st stream.Type) string
- func ReplyChannelBuilder(st stream.Type) string
- type Bus
- type Duplicator
- type Envelope
- func (e *Envelope) DecodeCommand(ctx context.Context, bytes []byte) (stream.Command, error)
- func (e *Envelope) DecodeReply(ctx context.Context, bytes []byte) (*stream.Reply, error)
- func (e *Envelope) EncodeCommand(ctx context.Context, cmd stream.Command) ([]byte, error)
- func (e *Envelope) EncodeReply(ctx context.Context, r *stream.Reply) ([]byte, error)
- type Error
- type MockDuplicator
- type MockDuplicatorMockRecorder
- type MockReceiver
- func (m *MockReceiver) Close() error
- func (m *MockReceiver) EXPECT() *MockReceiverMockRecorder
- func (m *MockReceiver) ListReceivers() []string
- func (m *MockReceiver) Receive(arg0 context.Context, arg1 stream.Type, arg2 ReceiverHandler) error
- func (m *MockReceiver) UnReceive(arg0 context.Context, arg1 stream.Type) error
- type MockReceiverHandler
- type MockReceiverHandlerMockRecorder
- type MockReceiverMockRecorder
- type MockReplier
- func (m *MockReplier) Close() error
- func (m *MockReplier) EXPECT() *MockReplierMockRecorder
- func (m *MockReplier) HasReplyReceiver(ctx context.Context, cid stream.CorrelationID) bool
- func (m *MockReplier) ListenReply(arg0 context.Context) error
- func (m *MockReplier) ReceiveReply(arg0 context.Context, arg1 stream.CorrelationID, arg2 ReplyReceiver)
- func (m *MockReplier) RemoveReplyReceiver(ctx context.Context, cid stream.CorrelationID)
- func (m *MockReplier) SendAndWaitReply(arg0 context.Context, arg1 stream.Command) (*stream.Reply, error)
- func (m *MockReplier) SendCommandWithReply(arg0 context.Context, arg1 stream.Command) error
- func (m *MockReplier) SendReply(arg0 context.Context, arg1 *stream.Reply) error
- type MockReplierMockRecorder
- func (mr *MockReplierMockRecorder) Close() *gomock.Call
- func (mr *MockReplierMockRecorder) HasReplyReceiver(ctx, cid interface{}) *gomock.Call
- func (mr *MockReplierMockRecorder) ListenReply(arg0 interface{}) *gomock.Call
- func (mr *MockReplierMockRecorder) ReceiveReply(arg0, arg1, arg2 interface{}) *gomock.Call
- func (mr *MockReplierMockRecorder) RemoveReplyReceiver(ctx, cid interface{}) *gomock.Call
- func (mr *MockReplierMockRecorder) SendAndWaitReply(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockReplierMockRecorder) SendCommandWithReply(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockReplierMockRecorder) SendReply(arg0, arg1 interface{}) *gomock.Call
- type MockReplyReceiver
- type MockReplyReceiverMockRecorder
- type MockSender
- type MockSenderMockRecorder
- type Option
- type Receiver
- type ReceiverCollector
- type ReceiverHandler
- type ReceiverHandlerFunc
- type ReceiverLogging
- type ReceiverMetrics
- type ReceiverMiddleware
- type ReceiverOption
- type Replier
- type ReplierCollector
- func (c *ReplierCollector) Close() error
- func (c *ReplierCollector) HasReplyReceiver(ctx context.Context, cid stream.CorrelationID) bool
- func (c *ReplierCollector) ListenReply(ctx context.Context) error
- func (c *ReplierCollector) ReceiveReply(ctx context.Context, cid stream.CorrelationID, r ReplyReceiver)
- func (c *ReplierCollector) RemoveReplyReceiver(ctx context.Context, cid stream.CorrelationID)
- func (c *ReplierCollector) SendAndWaitReply(ctx context.Context, cmd stream.Command) (r *stream.Reply, err error)
- func (c *ReplierCollector) SendCommandWithReply(ctx context.Context, cmd stream.Command) (err error)
- func (c *ReplierCollector) SendReply(ctx context.Context, r *stream.Reply) (err error)
- type ReplierMetrics
- func (r *ReplierMetrics) Observe(st stream.Type, ct stream.CommandType, start time.Time)
- func (r *ReplierMetrics) SendReplyObserve(st stream.Type, ct stream.CommandType, rr stream.ReplyType, start time.Time)
- func (r *ReplierMetrics) TimeoutObserve(st stream.Type, ct stream.CommandType, start time.Time)
- type ReplierMiddleware
- type ReplierOption
- type ReplyReceiver
- type ReplyReceiverCollector
- type ReplyReceiverFunc
- type ReplyReceiverLogging
- type ReplyReceiverMetrics
- type ReplyReceiverMiddleware
- type SendReplier
- type Sender
- type SenderCollector
- type SenderMetrics
- type SenderMiddleware
- type SenderOption
Constants ¶
const WildcardCorrelationID = stream.CorrelationID("*")
Variables ¶
Functions ¶
func ChannelBuilder ¶
func ReplyChannelBuilder ¶
Types ¶
type Duplicator ¶
type Duplicator interface { Has(context.Context, stream.Command) bool Ensure(context.Context, stream.Command) error }
func NewNopDuplicator ¶
func NewNopDuplicator() Duplicator
type Envelope ¶
type Envelope struct {
// contains filtered or unexported fields
}
func (*Envelope) DecodeCommand ¶
func (*Envelope) DecodeReply ¶
func (*Envelope) EncodeCommand ¶
type Error ¶
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 MockReceiver ¶
type MockReceiver struct {
// contains filtered or unexported fields
}
MockReceiver is a mock of Receiver interface
func NewMockReceiver ¶
func NewMockReceiver(ctrl *gomock.Controller) *MockReceiver
NewMockReceiver creates a new mock instance
func (*MockReceiver) EXPECT ¶
func (m *MockReceiver) EXPECT() *MockReceiverMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockReceiver) ListReceivers ¶
func (m *MockReceiver) ListReceivers() []string
ListReceivers mocks base method
func (*MockReceiver) Receive ¶
func (m *MockReceiver) Receive(arg0 context.Context, arg1 stream.Type, arg2 ReceiverHandler) error
Receive mocks base method
type MockReceiverHandler ¶
type MockReceiverHandler struct {
// contains filtered or unexported fields
}
MockReceiverHandler is a mock of ReceiverHandler interface
func NewMockReceiverHandler ¶
func NewMockReceiverHandler(ctrl *gomock.Controller) *MockReceiverHandler
NewMockReceiverHandler creates a new mock instance
func (*MockReceiverHandler) EXPECT ¶
func (m *MockReceiverHandler) EXPECT() *MockReceiverHandlerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
type MockReceiverHandlerMockRecorder ¶
type MockReceiverHandlerMockRecorder struct {
// contains filtered or unexported fields
}
MockReceiverHandlerMockRecorder is the mock recorder for MockReceiverHandler
func (*MockReceiverHandlerMockRecorder) Receive ¶
func (mr *MockReceiverHandlerMockRecorder) Receive(arg0, arg1 interface{}) *gomock.Call
Receive indicates an expected call of Receive
type MockReceiverMockRecorder ¶
type MockReceiverMockRecorder struct {
// contains filtered or unexported fields
}
MockReceiverMockRecorder is the mock recorder for MockReceiver
func (*MockReceiverMockRecorder) Close ¶
func (mr *MockReceiverMockRecorder) Close() *gomock.Call
Close indicates an expected call of Close
func (*MockReceiverMockRecorder) ListReceivers ¶
func (mr *MockReceiverMockRecorder) ListReceivers() *gomock.Call
ListReceivers indicates an expected call of ListReceivers
func (*MockReceiverMockRecorder) Receive ¶
func (mr *MockReceiverMockRecorder) Receive(arg0, arg1, arg2 interface{}) *gomock.Call
Receive indicates an expected call of Receive
func (*MockReceiverMockRecorder) UnReceive ¶
func (mr *MockReceiverMockRecorder) UnReceive(arg0, arg1 interface{}) *gomock.Call
UnReceive indicates an expected call of UnReceive
type MockReplier ¶
type MockReplier struct {
// contains filtered or unexported fields
}
MockReplier is a mock of Replier interface
func NewMockReplier ¶
func NewMockReplier(ctrl *gomock.Controller) *MockReplier
NewMockReplier creates a new mock instance
func (*MockReplier) EXPECT ¶
func (m *MockReplier) EXPECT() *MockReplierMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockReplier) HasReplyReceiver ¶
func (m *MockReplier) HasReplyReceiver(ctx context.Context, cid stream.CorrelationID) bool
HasReplyReceiver mocks base method
func (*MockReplier) ListenReply ¶
func (m *MockReplier) ListenReply(arg0 context.Context) error
ListenReply mocks base method
func (*MockReplier) ReceiveReply ¶
func (m *MockReplier) ReceiveReply(arg0 context.Context, arg1 stream.CorrelationID, arg2 ReplyReceiver)
ReceiveReply mocks base method
func (*MockReplier) RemoveReplyReceiver ¶
func (m *MockReplier) RemoveReplyReceiver(ctx context.Context, cid stream.CorrelationID)
RemoveReplyReceiver mocks base method
func (*MockReplier) SendAndWaitReply ¶
func (m *MockReplier) SendAndWaitReply(arg0 context.Context, arg1 stream.Command) (*stream.Reply, error)
SendAndWaitReply mocks base method
func (*MockReplier) SendCommandWithReply ¶
SendCommandWithReply mocks base method
type MockReplierMockRecorder ¶
type MockReplierMockRecorder struct {
// contains filtered or unexported fields
}
MockReplierMockRecorder is the mock recorder for MockReplier
func (*MockReplierMockRecorder) Close ¶
func (mr *MockReplierMockRecorder) Close() *gomock.Call
Close indicates an expected call of Close
func (*MockReplierMockRecorder) HasReplyReceiver ¶
func (mr *MockReplierMockRecorder) HasReplyReceiver(ctx, cid interface{}) *gomock.Call
HasReplyReceiver indicates an expected call of HasReplyReceiver
func (*MockReplierMockRecorder) ListenReply ¶
func (mr *MockReplierMockRecorder) ListenReply(arg0 interface{}) *gomock.Call
ListenReply indicates an expected call of ListenReply
func (*MockReplierMockRecorder) ReceiveReply ¶
func (mr *MockReplierMockRecorder) ReceiveReply(arg0, arg1, arg2 interface{}) *gomock.Call
ReceiveReply indicates an expected call of ReceiveReply
func (*MockReplierMockRecorder) RemoveReplyReceiver ¶
func (mr *MockReplierMockRecorder) RemoveReplyReceiver(ctx, cid interface{}) *gomock.Call
RemoveReplyReceiver indicates an expected call of RemoveReplyReceiver
func (*MockReplierMockRecorder) SendAndWaitReply ¶
func (mr *MockReplierMockRecorder) SendAndWaitReply(arg0, arg1 interface{}) *gomock.Call
SendAndWaitReply indicates an expected call of SendAndWaitReply
func (*MockReplierMockRecorder) SendCommandWithReply ¶
func (mr *MockReplierMockRecorder) SendCommandWithReply(arg0, arg1 interface{}) *gomock.Call
SendCommandWithReply indicates an expected call of SendCommandWithReply
func (*MockReplierMockRecorder) SendReply ¶
func (mr *MockReplierMockRecorder) SendReply(arg0, arg1 interface{}) *gomock.Call
SendReply indicates an expected call of SendReply
type MockReplyReceiver ¶
type MockReplyReceiver struct {
// contains filtered or unexported fields
}
MockReplyReceiver is a mock of ReplyReceiver interface
func NewMockReplyReceiver ¶
func NewMockReplyReceiver(ctrl *gomock.Controller) *MockReplyReceiver
NewMockReplyReceiver creates a new mock instance
func (*MockReplyReceiver) EXPECT ¶
func (m *MockReplyReceiver) EXPECT() *MockReplyReceiverMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockReplyReceiver) ReceiveReply ¶
ReceiveReply mocks base method
type MockReplyReceiverMockRecorder ¶
type MockReplyReceiverMockRecorder struct {
// contains filtered or unexported fields
}
MockReplyReceiverMockRecorder is the mock recorder for MockReplyReceiver
func (*MockReplyReceiverMockRecorder) Close ¶
func (mr *MockReplyReceiverMockRecorder) Close() *gomock.Call
Close indicates an expected call of Close
func (*MockReplyReceiverMockRecorder) ReceiveReply ¶
func (mr *MockReplyReceiverMockRecorder) ReceiveReply(arg0, arg1 interface{}) *gomock.Call
ReceiveReply indicates an expected call of ReceiveReply
type MockSender ¶
type MockSender struct {
// contains filtered or unexported fields
}
MockSender is a mock of Sender interface
func NewMockSender ¶
func NewMockSender(ctrl *gomock.Controller) *MockSender
NewMockSender creates a new mock instance
func (*MockSender) EXPECT ¶
func (m *MockSender) EXPECT() *MockSenderMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockSender) SendCommand ¶
SendCommand mocks base method
type MockSenderMockRecorder ¶
type MockSenderMockRecorder struct {
// contains filtered or unexported fields
}
MockSenderMockRecorder is the mock recorder for MockSender
func (*MockSenderMockRecorder) Close ¶
func (mr *MockSenderMockRecorder) Close() *gomock.Call
Close indicates an expected call of Close
func (*MockSenderMockRecorder) SendCommand ¶
func (mr *MockSenderMockRecorder) SendCommand(arg0, arg1 interface{}) *gomock.Call
SendCommand indicates an expected call of SendCommand
type Option ¶
type Option func(*bus)
func WithReceiverMiddleware ¶
func WithReceiverMiddleware(m ...ReceiverMiddleware) Option
func WithReplierMiddleware ¶
func WithReplierMiddleware(m ...ReplierMiddleware) Option
func WithReplyReceiverMiddleware ¶
func WithReplyReceiverMiddleware(m ...ReplyReceiverMiddleware) Option
func WithSenderMiddleware ¶
func WithSenderMiddleware(m ...SenderMiddleware) Option
type Receiver ¶
type Receiver interface { ListReceivers() []string Receive(context.Context, stream.Type, ReceiverHandler) error UnReceive(context.Context, stream.Type) error Close() error }
func NewReceiver ¶
type ReceiverCollector ¶
type ReceiverCollector struct {
// contains filtered or unexported fields
}
type ReceiverHandler ¶
func Endpoint ¶
func Endpoint(e endpoint.Endpoint) ReceiverHandler
type ReceiverHandlerFunc ¶
type ReceiverLogging ¶
type ReceiverLogging struct {
// contains filtered or unexported fields
}
type ReceiverMetrics ¶
func (*ReceiverMetrics) Observe ¶
func (r *ReceiverMetrics) Observe(st stream.Type, ct stream.CommandType, start time.Time)
type ReceiverMiddleware ¶
type ReceiverMiddleware func(ReceiverHandler) ReceiverHandler
func NewReceiverCollector ¶
func NewReceiverCollector(m *ReceiverMetrics) ReceiverMiddleware
func NewReceiverLogging ¶
func NewReceiverLogging(l log.Logger) ReceiverMiddleware
func WrapReceiver ¶
func WrapReceiver(em ReceiverMiddleware, ems ...ReceiverMiddleware) ReceiverMiddleware
type ReceiverOption ¶
type ReceiverOption func(*receiver)
func ReceiverChannelBuilder ¶
func ReceiverChannelBuilder(cb messaging.ChannelBuilderFunc) ReceiverOption
func ReceiverDuplicator ¶
func ReceiverDuplicator(d Duplicator) ReceiverOption
func ReceiverErrorHandler ¶
func ReceiverErrorHandler(h messaging.ErrorHandler) ReceiverOption
type Replier ¶
type Replier interface { ReceiveReply(context.Context, stream.CorrelationID, ReplyReceiver) SendReply(context.Context, *stream.Reply) error SendAndWaitReply(context.Context, stream.Command) (*stream.Reply, error) SendCommandWithReply(context.Context, stream.Command) error RemoveReplyReceiver(ctx context.Context, cid stream.CorrelationID) HasReplyReceiver(ctx context.Context, cid stream.CorrelationID) bool ListenReply(context.Context) error Close() error }
type ReplierCollector ¶
type ReplierCollector struct {
// contains filtered or unexported fields
}
func (*ReplierCollector) Close ¶
func (c *ReplierCollector) Close() error
func (*ReplierCollector) HasReplyReceiver ¶
func (c *ReplierCollector) HasReplyReceiver(ctx context.Context, cid stream.CorrelationID) bool
func (*ReplierCollector) ListenReply ¶
func (c *ReplierCollector) ListenReply(ctx context.Context) error
func (*ReplierCollector) ReceiveReply ¶
func (c *ReplierCollector) ReceiveReply(ctx context.Context, cid stream.CorrelationID, r ReplyReceiver)
func (*ReplierCollector) RemoveReplyReceiver ¶
func (c *ReplierCollector) RemoveReplyReceiver(ctx context.Context, cid stream.CorrelationID)
func (*ReplierCollector) SendAndWaitReply ¶
func (*ReplierCollector) SendCommandWithReply ¶
type ReplierMetrics ¶
type ReplierMetrics struct { TimeoutCounter metrics.Counter TimeoutHistogram metrics.Histogram Counter metrics.Counter Histogram metrics.Histogram SendReplyCounter metrics.Counter SendReplyHistogram metrics.Histogram }
func (*ReplierMetrics) Observe ¶
func (r *ReplierMetrics) Observe(st stream.Type, ct stream.CommandType, start time.Time)
func (*ReplierMetrics) SendReplyObserve ¶
func (r *ReplierMetrics) SendReplyObserve(st stream.Type, ct stream.CommandType, rr stream.ReplyType, start time.Time)
func (*ReplierMetrics) TimeoutObserve ¶
func (r *ReplierMetrics) TimeoutObserve(st stream.Type, ct stream.CommandType, start time.Time)
type ReplierMiddleware ¶
func NewReplierCollector ¶
func NewReplierCollector(m *ReplierMetrics) ReplierMiddleware
func WrapReplier ¶
func WrapReplier(em ReplierMiddleware, ems ...ReplierMiddleware) ReplierMiddleware
type ReplierOption ¶
type ReplierOption func(r *replier)
func ReplierChannelBuilder ¶
func ReplierChannelBuilder(cb messaging.ChannelBuilderFunc) ReplierOption
func ReplierErrorHandler ¶
func ReplierErrorHandler(h messaging.ErrorHandler) ReplierOption
func ReplierReplyChannelBuilder ¶
func ReplierReplyChannelBuilder(cb messaging.ChannelBuilderFunc) ReplierOption
func ReplierReplyTimeout ¶
func ReplierReplyTimeout(dur time.Duration) ReplierOption
type ReplyReceiver ¶
type ReplyReceiverCollector ¶
type ReplyReceiverCollector struct {
// contains filtered or unexported fields
}
func (*ReplyReceiverCollector) Close ¶
func (rc *ReplyReceiverCollector) Close() error
func (*ReplyReceiverCollector) ReceiveReply ¶
type ReplyReceiverFunc ¶
func (ReplyReceiverFunc) Close ¶
func (r ReplyReceiverFunc) Close() error
func (ReplyReceiverFunc) ReceiveReply ¶
type ReplyReceiverLogging ¶
type ReplyReceiverLogging struct {
// contains filtered or unexported fields
}
func (*ReplyReceiverLogging) Close ¶
func (l *ReplyReceiverLogging) Close() error
func (*ReplyReceiverLogging) ReceiveReply ¶
type ReplyReceiverMetrics ¶
type ReplyReceiverMiddleware ¶
type ReplyReceiverMiddleware func(ReplyReceiver) ReplyReceiver
func NewReplyReceiverCollector ¶
func NewReplyReceiverCollector(m *ReplyReceiverMetrics) ReplyReceiverMiddleware
func NewReplyReceiverLogging ¶
func NewReplyReceiverLogging(l log.Logger) ReplyReceiverMiddleware
func WrapReplyReceiver ¶
func WrapReplyReceiver(em ReplyReceiverMiddleware, ems ...ReplyReceiverMiddleware) ReplyReceiverMiddleware
type SendReplier ¶
type SenderCollector ¶
type SenderCollector struct {
// contains filtered or unexported fields
}
func (*SenderCollector) Close ¶
func (s *SenderCollector) Close() error
func (*SenderCollector) SendCommand ¶
type SenderMetrics ¶
func (*SenderMetrics) Observe ¶
func (r *SenderMetrics) Observe(st stream.Type, ct stream.CommandType, start time.Time)
type SenderMiddleware ¶
func NewSenderCollector ¶
func NewSenderCollector(m *SenderMetrics) SenderMiddleware
func WrapSender ¶
func WrapSender(em SenderMiddleware, ems ...SenderMiddleware) SenderMiddleware
type SenderOption ¶
type SenderOption func(*sender)
func SenderChannelBuilder ¶
func SenderChannelBuilder(cb messaging.ChannelBuilderFunc) SenderOption