Documentation ¶
Index ¶
- type Future
- type GPSFuture
- type NSQFuture
- type Option
- func ContentType(name string, codec gobroker.Codec) Option
- func GoogleJSON(projectID, cluster string, cred []byte) Option
- func GoogleJSONFile(projectID, cluster, filename string) Option
- func MaxReconnect(retry int) Option
- func NSQLookupd(address string) Option
- func RabbitMQAMQP(server, vHost string) Option
- type Publisher
- type RMQFuture
- type SubHandler
- type Subscriber
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Future ¶ added in v0.14.0
type Future interface { // Wait waits the broker to ack, will return error from the broker after sent the message if any. Wait() error }
type GPSFuture ¶ added in v0.14.0
type GPSFuture struct {
// contains filtered or unexported fields
}
type NSQFuture ¶ added in v0.14.0
type NSQFuture struct {
// contains filtered or unexported fields
}
type Option ¶ added in v0.3.0
type Option func(c *config)
Option configures Publisher & Subscriber
func ContentType ¶ added in v0.10.0
ContentType configures custom content-type for message body along with its codec
func GoogleJSON ¶ added in v0.3.0
GoogleJSON configures Publisher & Subscriber for Google Cloud Pub/Sub auth using JSON bytes
func GoogleJSONFile ¶ added in v0.3.0
GoogleJSONFile configures Publisher & Subscriber for Google Cloud Pub/Sub auth using JSON filename
func MaxReconnect ¶ added in v0.8.0
MaxReconnect defines retry attempts to reconnect, 0 means unlimited retry
func NSQLookupd ¶ added in v0.13.0
func RabbitMQAMQP ¶ added in v0.6.3
RabbitMQAMQP configures Publisher & Subscriber for RabbitMQ connection
type Publisher ¶
type Publisher interface { // Publish publishes a message to a worker pool and might block for broker ack. Publish(topic string, message interface{}) error // PublishAsync publishes a message to a worker pool without waiting for broker ack. PublishAsync(topic string, message interface{}) Future }
Publisher provides adapter to publish message
func NewPublisher ¶
func NewPublisher(impl gobroker.Implementation, options ...Option) Publisher
NewPublisher returns the publisher instance based on the desired implementation
type RMQFuture ¶ added in v0.14.0
type RMQFuture struct {
// contains filtered or unexported fields
}
type SubHandler ¶ added in v0.3.0
type SubHandler struct { Name string Topic string Handler gobroker.Handler Concurrent int MaxRequeue int MaxInFlight int // Timeout configures an in-flight message ack deadline processed by subscriber Timeout time.Duration }
SubHandler defines subscriber configuration
type Subscriber ¶
type Subscriber interface { // Start will spawn workers to subscribe Start() // Stop will terminate all connections and workers Stop() }
Subscriber provides adapter to subscribe topics
func NewSubscriber ¶
func NewSubscriber(impl gobroker.Implementation, handlers []*SubHandler, options ...Option) Subscriber
NewSubscriber returns the subscriber instance based on the desired implementation