Documentation
¶
Index ¶
- func NewConsumer() *consumer
- type Eventbus
- func (eb *Eventbus) Close() error
- func (eb *Eventbus) Publish(ctx context.Context, topic string, payload any) error
- func (eb *Eventbus) Subscribe(ctx context.Context, topic string, handler internal.EventHandler) error
- func (eb *Eventbus) Unsubscribe(ctx context.Context, topic string, handler internal.EventHandler) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewConsumer ¶
func NewConsumer() *consumer
Types ¶
type Eventbus ¶
type Eventbus struct {
// contains filtered or unexported fields
}
func NewEventbus ¶
func NewEventbus() *Eventbus
func (*Eventbus) Subscribe ¶
func (eb *Eventbus) Subscribe(ctx context.Context, topic string, handler internal.EventHandler) error
Subscribe 订阅事件
func (*Eventbus) Unsubscribe ¶
func (eb *Eventbus) Unsubscribe(ctx context.Context, topic string, handler internal.EventHandler) error
Unsubscribe 取消订阅
Click to show internal directories.
Click to hide internal directories.