Documentation ¶ Index ¶ func AddHandlers(handlers ...cqrs.EventHandler) func Close() error func Init(handlers ...cqrs.EventHandler) func InitEventBus() func Publish(ctx context.Context, event any) func PublishE(ctx context.Context, event any) error func Start(handlers ...cqrs.EventHandler) Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ func AddHandlers ¶ func AddHandlers(handlers ...cqrs.EventHandler) AddHandlers 添加事件处理器 func Close ¶ func Close() error Close 关闭事件总线 func Init ¶ func Init(handlers ...cqrs.EventHandler) Init 初始化事件总线并注册处理器 func InitEventBus ¶ func InitEventBus() InitEventBus 初始化事件总线 func Publish ¶ func Publish(ctx context.Context, event any) Publish 发布事件,并在失败时记录日志。 func PublishE ¶ added in v0.2.15 func PublishE(ctx context.Context, event any) error PublishE 发布事件,并把发布错误返回给调用方。 func Start ¶ func Start(handlers ...cqrs.EventHandler) Start 启动事件处理器 Types ¶ This section is empty. Source Files ¶ View all Source files eventbus.gologging.go Click to show internal directories. Click to hide internal directories.