Versions in this module Expand all Collapse all v5 v5.3.1 Sep 18, 2023 Changes in this version + const DefaultMessageExpire + const DefaultQueueExpire + const DefaultReconnectionAttemts + const DefaultReconnectionWait + type AnnounceHandler func(o *proxy.Announcement) + type Client interface + Close func() + Connect func() error + GetWildcardString func(w WildcardType) string + MultipleRequest func(topic string, req *proxy.Request, expectedResp int) ([]*proxy.Response, error) + MultipleRequestReturnFirstGoodResponse func(topic string, req *proxy.Request, expectedResp int) (*proxy.Response, error) + PublishPing func(topic string) error + Request func(topic string, req *proxy.Request) (*proxy.Response, error) + SubscribeAnnounce func(topic string, callback AnnounceHandler) (Subscription, error) + SubscribeEvent func(topic string, queue string, callback EventHandler) (Subscription, error) + TimeoutCount func() int64 + type Config struct + RequestTimeout time.Duration + TimeoutRetries int + URL string + type EventHandler func(b []byte) + type NatsBus struct + Config Config + Log log15.Logger + func NewNatsBus(config Config, options ...OptionNatsFunc) *NatsBus + func (n *NatsBus) Close() + func (n *NatsBus) Connect() error + func (n *NatsBus) GetWildcardString(w WildcardType) string + func (n *NatsBus) MultipleRequest(topic string, req *proxy.Request, expectedResp int) ([]*proxy.Response, error) + func (n *NatsBus) MultipleRequestReturnFirstGoodResponse(topic string, req *proxy.Request, expectedResp int) (*proxy.Response, error) + func (n *NatsBus) PublishAnnounce(topic string, msg *proxy.Announcement) error + func (n *NatsBus) PublishEvent(topic string, msg ari.Event) error + func (n *NatsBus) PublishPing(topic string) error + func (n *NatsBus) PublishResponse(topic string, msg *proxy.Response) error + func (n *NatsBus) Request(topic string, req *proxy.Request) (*proxy.Response, error) + func (n *NatsBus) SubscribeAnnounce(topic string, callback AnnounceHandler) (Subscription, error) + func (n *NatsBus) SubscribeCreateRequest(topic string, queue string, callback RequestHandler) (Subscription, error) + func (n *NatsBus) SubscribeEvent(topic string, queue string, callback EventHandler) (Subscription, error) + func (n *NatsBus) SubscribePing(topic string, callback PingHandler) (Subscription, error) + func (n *NatsBus) SubscribeRequest(topic string, callback RequestHandler) (Subscription, error) + func (n *NatsBus) SubscribeRequests(topics []string, callback RequestHandler) (Subscription, error) + func (n *NatsBus) TimeoutCount() int64 + type NatsMSubscription struct + Subscriptions []*nats.Subscription + func (n *NatsMSubscription) Unsubscribe() error + type OptionNatsFunc func(n *NatsBus) + func WithNatsConn(nconn *nats.EncodedConn) OptionNatsFunc + type OptionRabbitmqFunc func(n *RabbitmqBus) + func WithRabbitmqConn(rconn *amqp091.Connection) OptionRabbitmqFunc + type PingHandler func() + type RabbitmqBus struct + Config Config + Log log15.Logger + func NewRabbitmqBus(config Config, options ...OptionRabbitmqFunc) *RabbitmqBus + func (r *RabbitmqBus) Close() + func (r *RabbitmqBus) Connect() error + func (r *RabbitmqBus) GetWildcardString(w WildcardType) string + func (r *RabbitmqBus) MultipleRequest(topic string, req *proxy.Request, expectedResp int) ([]*proxy.Response, error) + func (r *RabbitmqBus) MultipleRequestReturnFirstGoodResponse(topic string, req *proxy.Request, expectedResp int) (*proxy.Response, error) + func (r *RabbitmqBus) PublishAnnounce(topic string, msg *proxy.Announcement) error + func (r *RabbitmqBus) PublishEvent(topic string, msg ari.Event) error + func (r *RabbitmqBus) PublishPing(topic string) error + func (r *RabbitmqBus) PublishResponse(topic string, msg *proxy.Response) error + func (r *RabbitmqBus) Request(topic string, req *proxy.Request) (*proxy.Response, error) + func (r *RabbitmqBus) SubscribeAnnounce(topic string, callback AnnounceHandler) (Subscription, error) + func (r *RabbitmqBus) SubscribeCreateRequest(topic string, queue string, callback RequestHandler) (Subscription, error) + func (r *RabbitmqBus) SubscribeEvent(topic string, queue string, callback EventHandler) (Subscription, error) + func (r *RabbitmqBus) SubscribePing(topic string, callback PingHandler) (Subscription, error) + func (r *RabbitmqBus) SubscribeRequest(topic string, callback RequestHandler) (Subscription, error) + func (r *RabbitmqBus) SubscribeRequests(topics []string, callback RequestHandler) (Subscription, error) + func (r *RabbitmqBus) TimeoutCount() int64 + type RequestHandler func(subject string, reply string, req *proxy.Request) + type ResponseHandler func(req *proxy.Response) + type RmqSubscription struct + Exchange string + ExchangeKind string + Queue string + QueueArgs amqp091.Table + Topics []string + func (rs *RmqSubscription) Unsubscribe() error + type Server interface + Close func() + Connect func() error + PublishAnnounce func(topic string, msg *proxy.Announcement) error + PublishEvent func(topic string, msg ari.Event) error + PublishResponse func(topic string, msg *proxy.Response) error + SubscribeCreateRequest func(topic string, queue string, callback RequestHandler) (Subscription, error) + SubscribePing func(topic string, callback PingHandler) (Subscription, error) + SubscribeRequest func(topic string, callback RequestHandler) (Subscription, error) + SubscribeRequests func(topics []string, callback RequestHandler) (Subscription, error) + type Subscription interface + Unsubscribe func() error + type Type int + const TypeNats + const TypeRabbitmq + const TypeUnknown + func GetType(url string) Type + type WildcardType int + const WildcardOneWord + const WildcardUndefined + const WildcardZeroOrMoreWords