Documentation
¶
Index ¶
- func AddDynamicSubscription[TH event.IDynamicIntegrationEventHandler](eventName string)
- func AddSubscription[T event.IntegrationEvent, TH event.IntegrationEventHandler[T]]()
- func RemoveDynamicSubscription(eventName string)
- func RemoveSubscription[T event.IntegrationEvent]()
- type EventBusConfig
- type IEventBus
- type IEventBusSubscriptionsManager
- type JsonMarshaler
- type Marshaler
- type OnEventErrorFn
- type OnEventErrorParams
- type OnEventSendFn
- type OnEventSendParams
- type ProtobufMarshaler
- type SubscriptionInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddDynamicSubscription ¶
func AddDynamicSubscription[TH event.IDynamicIntegrationEventHandler](eventName string)
func AddSubscription ¶
func AddSubscription[T event.IntegrationEvent, TH event.IntegrationEventHandler[T]]()
func RemoveDynamicSubscription ¶
func RemoveDynamicSubscription(eventName string)
func RemoveSubscription ¶
func RemoveSubscription[T event.IntegrationEvent]()
Types ¶
type EventBusConfig ¶
type EventBusConfig struct {
// 错误重试次数
Retry int
// 发布事件前触发
OnPublishBefore OnEventSendFn
// 发布事件后触发
OnPublishAfter OnEventSendFn
// 内部错误
OnError OnEventErrorFn
// 序列化器
Marshaler Marshaler
}
type IEventBusSubscriptionsManager ¶
type IEventBusSubscriptionsManager struct {
OnEventRemoved map[string]chan int
// contains filtered or unexported fields
}
var SubscriptionsManager *IEventBusSubscriptionsManager
func (*IEventBusSubscriptionsManager) Clear ¶
func (c *IEventBusSubscriptionsManager) Clear()
func (*IEventBusSubscriptionsManager) GetEventType ¶
func (c *IEventBusSubscriptionsManager) GetEventType(eventName string) reflect.Type
func (*IEventBusSubscriptionsManager) GetHandler ¶
func (c *IEventBusSubscriptionsManager) GetHandler(eventName string) *SubscriptionInfo
func (*IEventBusSubscriptionsManager) IsEmpty ¶
func (c *IEventBusSubscriptionsManager) IsEmpty() bool
type JsonMarshaler ¶
type JsonMarshaler struct{}
type OnEventErrorFn ¶
type OnEventErrorFn func(params OnEventErrorParams)
type OnEventErrorParams ¶
type OnEventSendFn ¶
type OnEventSendFn func(params OnEventSendParams) error
type OnEventSendParams ¶
type ProtobufMarshaler ¶
type ProtobufMarshaler struct{}
type SubscriptionInfo ¶
func (SubscriptionInfo) Dynamic ¶
func (c SubscriptionInfo) Dynamic(h reflect.Type)
func (SubscriptionInfo) Typed ¶
func (c SubscriptionInfo) Typed(h reflect.Type)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.