Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( SupportExchangeTypeList = []ExchangeType{ ExchangeType_Topic, ExchangeType_Direct, ExchangeType_Fanout, ExchangeType_Header, } )
Functions ¶
This section is empty.
Types ¶
type ExchangeType ¶
type ExchangeType string
const ( ExchangeType_Topic ExchangeType = amqp.ExchangeTopic ExchangeType_Direct ExchangeType = amqp.ExchangeDirect ExchangeType_Fanout ExchangeType = amqp.ExchangeFanout ExchangeType_Header ExchangeType = amqp.ExchangeHeaders )
func ValidateExchangeType ¶
func ValidateExchangeType(exchangeType string) (ExchangeType, error)
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
func InitQueueOption ¶
func InitQueueOption(exchangeName string, exchangeType ExchangeType, bindingKey, queueName string, header map[string]interface{}) Option
func KeepliveOption ¶
type RabbitMQ ¶
type RabbitMQ interface { // dial rabbit and init queue with exchange and queuebind. Dial() error // publish message. // header spec for queue with header exchange, default x-match: all. Publish(body []byte, exchangeName, routingKey string, header ...map[string]interface{}) error // subscribe operation occur error will finish // and // will block until ack & nack occured error or context was canceled Consume(ctx context.Context, queueName, consumerName string, consumer ConsumeFunc) // return the subscribe operation occured error or ack & nack error. ConsumeDone() <-chan error }
Click to show internal directories.
Click to hide internal directories.