Documentation ¶
Index ¶
- func NewLogger(handler log.Logger) watermill.LoggerAdapter
- func NewPublisher(conf *Config, opts ...Option) (*amqp.Publisher, error)
- func NewPublisherAndSubscriber(conf *Config, opts ...Option) (publisher message.Publisher, subscriber message.Subscriber, err error)
- func NewPublisherAndSubscriberWithConnection(conn *ConnectionWrapper, opts ...Option) (publisher message.Publisher, subscriber message.Subscriber, err error)
- func NewPublisherWithConnection(conn *ConnectionWrapper, opts ...Option) (*amqp.Publisher, error)
- func NewSubscriber(conf *Config, opts ...Option) (*amqp.Subscriber, error)
- func NewSubscriberWithConnection(conn *ConnectionWrapper, opts ...Option) (*amqp.Subscriber, error)
- type Config
- type ConnectionWrapper
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewPublisher ¶
NewPublisher 发布者 注意:Close 同步调用了 conn.Close
func NewPublisherAndSubscriber ¶ added in v0.3.29
func NewPublisherAndSubscriber(conf *Config, opts ...Option) (publisher message.Publisher, subscriber message.Subscriber, err error)
NewPublisherAndSubscriber 发布订阅 注意:Close 同步调用了 conn.Close
func NewPublisherAndSubscriberWithConnection ¶ added in v0.3.30
func NewPublisherAndSubscriberWithConnection(conn *ConnectionWrapper, opts ...Option) (publisher message.Publisher, subscriber message.Subscriber, err error)
NewPublisherAndSubscriberWithConnection 发布订阅 注意:Close 同步调用了 conn.Close
func NewPublisherWithConnection ¶ added in v0.3.29
func NewPublisherWithConnection(conn *ConnectionWrapper, opts ...Option) (*amqp.Publisher, error)
NewPublisherWithConnection 发布者 注意:Close 同步调用了 conn.Close
func NewSubscriber ¶
func NewSubscriber(conf *Config, opts ...Option) (*amqp.Subscriber, error)
NewSubscriber 订阅者 注意:Close 同步调用了 conn.Close
func NewSubscriberWithConnection ¶ added in v0.3.29
func NewSubscriberWithConnection(conn *ConnectionWrapper, opts ...Option) (*amqp.Subscriber, error)
NewSubscriberWithConnection 发布者 注意:Close 同步调用了 conn.Close
Types ¶
type Config ¶
type Config struct { Url string TlsAddress string TlsCaPem string TlsCertPem string TlsKeyPem string }
Config rabbitmq config
type ConnectionWrapper ¶ added in v0.3.29
type ConnectionWrapper struct { *amqp.ConnectionWrapper // contains filtered or unexported fields }
func NewConnection ¶
func NewConnection(conf *Config, opts ...Option) (*ConnectionWrapper, error)
NewConnection 链接 已默认支持重连机制: amqp.DefaultReconnectConfig
type Option ¶
type Option func(*options)
Option is config option.
func WithKratosLogger ¶ added in v0.3.29
func WithNonDurable ¶ added in v0.3.29
func WithNonDurable() Option
Click to show internal directories.
Click to hide internal directories.