Versions in this module Expand all Collapse all v2 v2.1.2 Apr 12, 2023 Changes in this version + var DefaultAddress = "127.0.0.1:0" + var DefaultPath = "/" + func Connect() error + func Disconnect() error + func Init(opts ...Option) error + func Publish(topic string, msg *Message, opts ...PublishOption) error + func String() string + type Broker interface + Address func() string + Connect func() error + Disconnect func() error + Init func(...Option) error + Options func() Options + Publish func(topic string, m *Message, opts ...PublishOption) error + String func() string + Subscribe func(topic string, h Handler, opts ...SubscribeOption) (Subscriber, error) + var DefaultBroker Broker = NewBroker() + func NewBroker(opts ...Option) Broker + type Event interface + Ack func() error + Error func() error + Message func() *Message + Topic func() string + type Handler func(Event) error + type Message struct + Body []byte + Header map[string]string + type Option func(*Options) + func Addrs(addrs ...string) Option + func Codec(c codec.Marshaler) Option + func ErrorHandler(h Handler) Option + func Registry(r registry.Registry) Option + func Secure(b bool) Option + func TLSConfig(t *tls.Config) Option + type Options struct + Addrs []string + Codec codec.Marshaler + Context context.Context + ErrorHandler Handler + Registry registry.Registry + Secure bool + TLSConfig *tls.Config + type PublishOption func(*PublishOptions) + func PublishContext(ctx context.Context) PublishOption + type PublishOptions struct + Context context.Context + type SubscribeOption func(*SubscribeOptions) + func DisableAutoAck() SubscribeOption + func Queue(name string) SubscribeOption + func SubscribeContext(ctx context.Context) SubscribeOption + type SubscribeOptions struct + AutoAck bool + Context context.Context + Queue string + func NewSubscribeOptions(opts ...SubscribeOption) SubscribeOptions + type Subscriber interface + Options func() SubscribeOptions + Topic func() string + Unsubscribe func() error + func Subscribe(topic string, handler Handler, opts ...SubscribeOption) (Subscriber, error)