Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Acknowledge ¶
type Acknowledge int
Acknowledge is an action that occurs after processed this message.
const ( // Ack default ack this msg after you have successfully processed this message. Ack Acknowledge = iota // NackDiscard the message will be dropped or delivered to a server configured dead-letter queue. NackDiscard // NackRequeue deliver this message to a different consumer. NackRequeue // None for auto ack option. None )
type ChannelManager ¶
type ChannelManager interface {
// contains filtered or unexported methods
}
type Message ¶
type Message struct {
Body interface{}
}
Message captures the fields for a message received from queue.
type Messaging ¶
type Messaging interface { AddWorker(queue string, handler WorkerHandler) error AddWorkerWithOptions(queue string, handler WorkerHandler, options *WorkerOptions) error SendPush(queue string, data interface{}) error SendPushWithOptions(queue string, data interface{}, options *PushOptions) error RpcCall(queue string, data interface{}) (error, interface{}) Publish(queue string, data interface{}) error PublishWithOptions(queue string, data interface{}, options *PublishOptions) error Subscribe(queue string, handler SubscribeHandler) error SubscribeWithOptions(queue string, handler SubscribeHandler, options *SubscribeOptions) error CancelWorkers() error RegisterType(value interface{}) }
func NewMessaging ¶
func NewMessagingWithOptions ¶
func NewMessagingWithOptions(url string, options *MessagingOptions) (Messaging, error)
type MessagingOptions ¶
MessagingOptions defines options of messaging.
type PublishOptions ¶
type PublishOptions struct {
Durable bool
}
PublishOptions defines options of publish.
type PushOptions ¶
type PushOptions struct {
Persistent bool
}
PushOptions defines options of worker.
type SubscribeHandler ¶
type SubscribeHandler func(message Message)
SubscribeHandler defines the subscribe function.
type SubscribeOptions ¶
SubscribeOptions defines options of subscribe.
type Subscriber ¶
type Subscriber struct {
// contains filtered or unexported fields
}
type WorkerHandler ¶
type WorkerHandler func(message Message) (interface{}, Acknowledge)
WorkerHandler defines the worker function with Data message param.
Click to show internal directories.
Click to hide internal directories.