rabbitmqpkg

package
v0.3.8 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 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 NewConnection

func NewConnection(conf *Config, opts ...Option) (*amqp.ConnectionWrapper, error)

NewConnection 链接 已默认支持重连机制: amqp.DefaultReconnectConfig

func NewLogger

func NewLogger(handler log.Logger) watermill.LoggerAdapter

NewLogger ...

func NewPubSub

func NewPubSub(conf *Config, opts ...Option) (publisher message.Publisher, subscriber message.Subscriber, err error)

NewPubSub 发布订阅 注意:Close 同步调用了 conn.Close

func NewPublisher

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

NewPublisher 发布者 注意:Close 同步调用了 conn.Close

func NewSubscriber

func NewSubscriber(conf *Config, opts ...Option) (*amqp.Subscriber, error)

NewSubscriber 订阅者 注意:Close 同步调用了 conn.Close

Types

type Config

type Config struct {
	Url        string
	TlsAddress string
	TlsCaPem   string
	TlsCertPem string
	TlsKeyPem  string
}

Config rabbitmq config

type Option

type Option func(*options)

Option is config option.

func WithLogger

func WithLogger(logger watermill.LoggerAdapter) Option

WithLogger 日志

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