Documentation
¶
Overview ¶
Package natsx is a generated GoMock package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var (
ErrInvalidSubscriber = errors.New("invalid subscriber")
)
Functions ¶
This section is empty.
Types ¶
type MockPublisherItf ¶ added in v1.1.0
type MockPublisherItf struct {
// contains filtered or unexported fields
}
MockPublisherItf is a mock of PublisherItf interface.
func NewMockPublisherItf ¶ added in v1.1.0
func NewMockPublisherItf(ctrl *gomock.Controller) *MockPublisherItf
NewMockPublisherItf creates a new mock instance.
func (*MockPublisherItf) EXPECT ¶ added in v1.1.0
func (m *MockPublisherItf) EXPECT() *MockPublisherItfMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockPublisherItfMockRecorder ¶ added in v1.1.0
type MockPublisherItfMockRecorder struct {
// contains filtered or unexported fields
}
MockPublisherItfMockRecorder is the mock recorder for MockPublisherItf.
func (*MockPublisherItfMockRecorder) Publish ¶ added in v1.1.0
func (mr *MockPublisherItfMockRecorder) Publish(subj, data interface{}) *gomock.Call
Publish indicates an expected call of Publish.
type MockSubscriberItf ¶ added in v1.1.0
type MockSubscriberItf struct {
// contains filtered or unexported fields
}
MockSubscriberItf is a mock of SubscriberItf interface.
func NewMockSubscriberItf ¶ added in v1.1.0
func NewMockSubscriberItf(ctrl *gomock.Controller) *MockSubscriberItf
NewMockSubscriberItf creates a new mock instance.
func (*MockSubscriberItf) EXPECT ¶ added in v1.1.0
func (m *MockSubscriberItf) EXPECT() *MockSubscriberItfMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockSubscriberItfMockRecorder ¶ added in v1.1.0
type MockSubscriberItfMockRecorder struct {
// contains filtered or unexported fields
}
MockSubscriberItfMockRecorder is the mock recorder for MockSubscriberItf.
func (*MockSubscriberItfMockRecorder) Handle ¶ added in v1.1.0
func (mr *MockSubscriberItfMockRecorder) Handle(ctx, message interface{}) *gomock.Call
Handle indicates an expected call of Handle.
type PublisherItf ¶ added in v1.1.0
type Subscriber ¶
type Subscriber struct {
Subject string
Queue string
Method string
// contains filtered or unexported fields
}
func NewSubscriber ¶
func NewSubscriber( ctrl *SubscriberController, subj, queue string, subscriber SubscriberItf, ) *Subscriber
func (*Subscriber) HandleMessage ¶ added in v1.1.0
func (c *Subscriber) HandleMessage(message *nats.Msg)
type SubscriberController ¶
type SubscriberController struct {
// contains filtered or unexported fields
}
func NewSubscriberController ¶
func NewSubscriberController(conn *nats.Conn, interceptors ...SubscriberInterceptor) *SubscriberController
func (*SubscriberController) AddQueue ¶ added in v1.1.0
func (c *SubscriberController) AddQueue(params []SubscriberParam) error
func (*SubscriberController) AddQueueSubscriber ¶
func (c *SubscriberController) AddQueueSubscriber(params []SubscriberParam) error
func (*SubscriberController) Close ¶ added in v1.1.0
func (c *SubscriberController) Close()
func (*SubscriberController) Serve ¶
func (c *SubscriberController) Serve()
type SubscriberHandler ¶
type SubscriberHandler func(ctx context.Context, subscriber *Subscriber) error
SubscriberHandler is the handler definition to run a subscriber.
type SubscriberInterceptor ¶
type SubscriberInterceptor func(ctx context.Context, subscriber *Subscriber, handler SubscriberHandler) error
SubscriberInterceptor is the middleware that will be executed before the current handler.
func SubscriberChain ¶
func SubscriberChain(interceptors ...SubscriberInterceptor) SubscriberInterceptor
SubscriberChain returns a single interceptor from multiple interceptors.
type SubscriberItf ¶ added in v1.1.0
SubscriberItf is subscriber interface to consume nats message.
type SubscriberParam ¶
type SubscriberParam struct {
Subject string
Queue string
Subscriber SubscriberItf
}