fox/service/topic.go

24 lines
386 B
Go
Raw Normal View History

2025-05-25 20:02:15 +08:00
package service
2025-05-26 16:02:54 +08:00
const (
extTopic = ".topic"
extGroup = ".group"
2025-05-25 20:02:15 +08:00
)
// 每个服务都有自己的服务topic
func Topic(s IService) string {
2025-05-26 16:02:54 +08:00
return s.Name() + extTopic
}
func TopicEx(serviceName string) string {
return serviceName + extTopic
2025-05-25 20:02:15 +08:00
}
func GroupTopic(s IService) string {
2025-05-26 16:02:54 +08:00
return s.Type() + extTopic
2025-05-25 20:02:15 +08:00
}
func GroupQueue(s IService) string {
2025-05-26 16:02:54 +08:00
return s.Type() + extGroup
2025-05-25 20:02:15 +08:00
}