rabbitmq

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 24, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Direct  = "direct"
	Topic   = "topic"
	Fanout  = "fanout"
	Headers = "headers"
)
View Source
const DefaultReconnectInterval = 2

Variables

This section is empty.

Functions

This section is empty.

Types

type ChannelCloseListener

type ChannelCloseListener func()

type Config

type Config struct {
	Enable            bool   `mapstructure:"enable"`
	Url               string `mapstructure:"url"`
	Vhost             string `mapstructure:"vhost"`
	Locale            string `mapstructure:"locale"`
	ReconnectInterval int    `mapstructure:"reconnectInterval"` // 断线重连的频率,单位:秒,默认2秒
}

type Rabbit

type Rabbit struct {
	// contains filtered or unexported fields
}

func CreateRabbit

func CreateRabbit(c Config) (*Rabbit, error)

func (*Rabbit) Close

func (r *Rabbit) Close()

func (*Rabbit) CloseChannel

func (r *Rabbit) CloseChannel(channel *amqp091.Channel)

func (*Rabbit) CreateChannel

func (r *Rabbit) CreateChannel() (*amqp091.Channel, error)

func (*Rabbit) Disconnected

func (r *Rabbit) Disconnected() bool

func (*Rabbit) GetConfig

func (r *Rabbit) GetConfig() *Config

func (*Rabbit) SetChannelCloseListener

func (r *Rabbit) SetChannelCloseListener(channel *amqp091.Channel, listener ChannelCloseListener)

Jump to

Keyboard shortcuts

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