Documentation
¶
Index ¶
- Constants
- type Config
- type Consumer
- type IConsumer
- type IPublisher
- type IRabbitMQ
- type Option
- type Publisher
- type RabbitMQ
- func (mq *RabbitMQ) BindQueue(exchange, routingKey string) error
- func (mq *RabbitMQ) ChanelIsClosed() bool
- func (mq *RabbitMQ) CloseChannel() error
- func (mq *RabbitMQ) CloseConnection() error
- func (mq *RabbitMQ) DeclareExchange() error
- func (mq *RabbitMQ) DeclareQueue() error
- func (mq *RabbitMQ) EnsureConnection() (err error)
- func (mq *RabbitMQ) NewChannel() (*amqp.Channel, error)
- func (mq *RabbitMQ) NewConnection() (*amqp.Connection, error)
- func (mq *RabbitMQ) Setup()
Constants ¶
View Source
const (
ConsumerThreads = 10
)
View Source
const (
WaitTimeReconnect = 5
)
Rabbitmq constant
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { AMQPUrl string `json:"amqp_url"` Host string `json:"host"` Port string `json:"port"` Vhost string `json:"vhost"` Username string `json:"username"` Password string `json:"password"` ExchangeName string `json:"exchange_name"` ExchangeType string `json:"exchange_type"` QueueName string `json:"queue_name"` }
type Consumer ¶
type Consumer struct { *RabbitMQ // contains filtered or unexported fields }
func (*Consumer) ConsumingMessage ¶
type IPublisher ¶
func NewPublisher ¶
func NewPublisher(opts ...Option) IPublisher
type IRabbitMQ ¶
type IRabbitMQ interface { NewConnection() (*amqp.Connection, error) CloseConnection() error NewChannel() (*amqp.Channel, error) EnsureConnection() (err error) CloseChannel() error DeclareExchange() error DeclareQueue() error BindQueue(exchange, routingKey string) error Setup() ChanelIsClosed() bool }
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option rabbitmq option
func WithErrorHandleFn ¶
WithErrorHandleFn set errHandleFn
func WithHandleFn ¶
WithHandleFn set handleFn
type RabbitMQ ¶
type RabbitMQ struct {
// contains filtered or unexported fields
}
func (*RabbitMQ) ChanelIsClosed ¶
func (*RabbitMQ) CloseChannel ¶
func (*RabbitMQ) CloseConnection ¶
func (*RabbitMQ) DeclareExchange ¶
func (*RabbitMQ) DeclareQueue ¶
func (*RabbitMQ) EnsureConnection ¶
func (*RabbitMQ) NewConnection ¶
func (mq *RabbitMQ) NewConnection() (*amqp.Connection, error)
Click to show internal directories.
Click to hide internal directories.