Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrInvalidSubscriber = errors.New("invalid subscriber")
)
Functions ¶
This section is empty.
Types ¶
type Subscriber ¶
Subscriber is subscriber interface to consume nats message.
type SubscriberController ¶
type SubscriberController struct {
// contains filtered or unexported fields
}
func NewSubscriberController ¶
func NewSubscriberController(conn *nats.Conn, interceptors ...SubscriberInterceptor) *SubscriberController
func (*SubscriberController) AddQueueSubscriber ¶
func (c *SubscriberController) AddQueueSubscriber(params []SubscriberParam) error
func (*SubscriberController) Serve ¶
func (c *SubscriberController) Serve()
type SubscriberHandler ¶
type SubscriberHandler func(ctx context.Context, subscriber *SubscriberImpl) error
SubscriberHandler is the handler definition to run a subscriber.
type SubscriberImpl ¶
type SubscriberImpl struct { Subject string Queue string Method string // contains filtered or unexported fields }
func NewSubscriber ¶
func NewSubscriber( ctrl *SubscriberController, subj, queue string, subscriber Subscriber, ) *SubscriberImpl
func (*SubscriberImpl) HandleMessage ¶
func (c *SubscriberImpl) HandleMessage(message *nats.Msg)
type SubscriberInterceptor ¶
type SubscriberInterceptor func(ctx context.Context, subscriber *SubscriberImpl, 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 SubscriberParam ¶
type SubscriberParam struct { Subject string Queue string Subscriber Subscriber }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.