Documentation
¶
Index ¶
Constants ¶
View Source
const (
APP_NAME = "bus"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventHandler ¶
type EventHandler func(*Event)
type Service ¶
type Service interface {
Publisher
SubScriber
}
func GetService ¶
func GetService() Service
type SubScriber ¶
type SubScriber interface {
// 订阅事件
Subscribe(ctx context.Context, subject string, cb EventHandler) error
// 订阅队列
// subject: 主题
// queue: 队列名称, kafka则为消费组名称
Queue(ctx context.Context, subject string, cb EventHandler) error
}
Click to show internal directories.
Click to hide internal directories.