Documentation ¶
Index ¶
- 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 SubHandler
- type Subscriber
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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 ¶
Publisher provides adapter to publish message
func NewPublisher ¶
func NewPublisher(impl gobroker.Implementation, options ...Option) Publisher
NewPublisher implements adapter instance for Publisher
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 implements adapter instance for Subscriber