Documentation ¶
Index ¶
- Constants
- func RabbitMQServiceFactory(rawConfig map[string]string) (mq.MQService, error)
- type ChannelType
- type Config
- type RabbitMQService
- func (s *RabbitMQService) Connect() error
- func (s *RabbitMQService) DelaySend(topic string, msg []byte, handleTime time.Time) (msgID string, err error)
- func (s *RabbitMQService) RegisterHandler(topic string, handler mq.MQMsgHandler)
- func (s *RabbitMQService) Send(topic string, msg []byte) (msgID string, err error)
Constants ¶
View Source
const (
MQType = "rabbitmq"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ChannelType ¶
type ChannelType string
const ( Direct ChannelType = "direct" PubSub ChannelType = "pub_sub" Delay ChannelType = "delay" )
type Config ¶
type Config struct { Host string `yaml:"host"` Port string `yaml:"port"` Username string `yaml:"username"` Password string `yaml:"password"` AutoACK bool `yaml:"auto_ack"` QueueName string `yaml:"queue"` // 可为空,代表生成一个no-durable的队列,名字由系统给定 ExchangeName string `yaml:"exchange"` // 可为空,若为空则不会使用exchange,而是往queue中直接发送;pubsub和delay必须指定 Type ChannelType `yaml:"type"` // direct/pub_sub/delay // aliyun Endpoint string `yaml:"endpoint"` AccessKey string `yaml:"access_key"` SecretKey string `yaml:"secret_key"` InstanceID string `yaml:"instance_id"` ConsumerGroupID string `yaml:"consumer_group_id"` }
type RabbitMQService ¶
type RabbitMQService struct {
// contains filtered or unexported fields
}
func (*RabbitMQService) Connect ¶
func (s *RabbitMQService) Connect() error
func (*RabbitMQService) RegisterHandler ¶
func (s *RabbitMQService) RegisterHandler(topic string, handler mq.MQMsgHandler)
Click to show internal directories.
Click to hide internal directories.