37 lines
1.1 KiB
Go
Executable File
37 lines
1.1 KiB
Go
Executable File
package rabbitmq
|
|
|
|
type RabbitListenerConf struct {
|
|
URL string // rabbitmq url
|
|
RouteKey string // routing key
|
|
Exchange ExchangeConf // rabbitmq exchange
|
|
ListenerQueue QueueConf
|
|
Concurrency int `json:",default=1"` // number of messages consumed in parallel
|
|
}
|
|
|
|
type RabbitSenderConf struct {
|
|
URL string // rabbitmq url
|
|
Exchange ExchangeConf // rabbitmq exchange
|
|
ContentType string `json:",default=text/plain"` // content type
|
|
Concurrency int `json:",default=1"` // number of messages sent in parallel
|
|
|
|
}
|
|
|
|
type ExchangeConf struct {
|
|
Name string
|
|
Type string `json:",default=topic,options=direct|fanout|topic|headers"`
|
|
Durable bool `json:",default=true"`
|
|
AutoDelete bool `json:",default=false"`
|
|
Internal bool `json:",default=false"`
|
|
NoWait bool `json:",default=false"`
|
|
}
|
|
|
|
type QueueConf struct {
|
|
Name string
|
|
AutoAck bool `json:",default=true"`
|
|
Durable bool `json:",default=true"`
|
|
AutoDelete bool `json:",default=false"`
|
|
Exclusive bool `json:",default=false"`
|
|
NoLocal bool `json:",default=false"`
|
|
NoWait bool `json:",default=false"`
|
|
}
|