Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HelperModule ¶
HelperModule returns fx module for initialization of helper to start NATS client for handlers.
The module is only loaded once.
func QueueValue ¶
func QueueValue() string
QueueValue returns the queue from the configuration via "faas.nats.queue" key.
func SubjectsValue ¶
func SubjectsValue() []string
SubjectValue returns the subjects from the configuration via "faas.nats.subjects" key.
Types ¶
type Helper ¶
type Helper struct {
// contains filtered or unexported fields
}
Helper assists in creating event handlers.
func NewDefaultHelper ¶
func NewDefaultHelper(ctx context.Context, subscriber *nats.Subscriber, handler *cloudevents.HandlerWrapper) *Helper
NewHelper returns a new Helper with default options.
func NewHelper ¶
func NewHelper(ctx context.Context, subscriber *nats.Subscriber, options *Options, handler *cloudevents.HandlerWrapper) *Helper
NewHelper returns a new Helper with options.
type Options ¶
Options can be used to create customized handler.
func DefaultOptions ¶
DefaultOptions returns options based in config.
type SubscriberListener ¶
type SubscriberListener struct {
// contains filtered or unexported fields
}
SubscriberListener represents a subscriber listener.
func NewSubscriberListener ¶
func NewSubscriberListener(q *nats.Subscriber, handler *cloudevents.HandlerWrapper, subject string, queue string) *SubscriberListener
NewSubscriberListener returns a subscriber listener.
func (*SubscriberListener) Subscribe ¶
func (l *SubscriberListener) Subscribe(ctx context.Context) (*n.Subscription, error)
Subscribe subscribes to a particular subject in the listening subscriber's queue.