rabbitmqpkg

package
v0.3.30 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 23, 2024 License: Apache-2.0 Imports: 5 Imported by: 1

README

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLogger

func NewLogger(handler log.Logger) watermill.LoggerAdapter

NewLogger ...

func NewPublisher

func NewPublisher(conf *Config, opts ...Option) (*amqp.Publisher, error)

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 WithKratosLogger(logger log.Logger) Option

func WithLogger

func WithLogger(logger watermill.LoggerAdapter) Option

WithLogger 日志

func WithNonDurable added in v0.3.29

func WithNonDurable() Option

func WithTLSConfig

func WithTLSConfig(tlsConfig *tls.Config) Option

WithTLSConfig tls

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL