Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseEvent ¶
func (BaseEvent) OccurredAt ¶
type Bus ¶
type Bus struct {
// contains filtered or unexported fields
}
Bus is a simple in-memory event bus.
func (*Bus) Subscribe ¶
func (b *Bus) Subscribe(eventType string, handler EventHandler)
Subscribe registers a handler for the given event type.
func (*Bus) SubscribeOnce ¶
func (b *Bus) SubscribeOnce(eventType string, handler EventHandler)
SubscribeOnce registers a handler that will be called only once for the given event type.
func (*Bus) Unsubscribe ¶
func (b *Bus) Unsubscribe(eventType string, handler EventHandler)
Unsubscribe removes a handler for the given event type. Note: This implementation does not actually remove the handler because we don't have a way to identify it. In a real implementation, you might return a subscription object that can be used to unsubscribe.
type EventHandler ¶
type EventHandler func(event interface{})
EventHandler is a function that handles an event.
type FileUploaded ¶
func (FileUploaded) Name ¶
func (e FileUploaded) Name() string
func (FileUploaded) Version ¶
func (e FileUploaded) Version() int
type InMemoryBus ¶
type InMemoryBus struct {
// contains filtered or unexported fields
}
func NewInMemoryBus ¶
func NewInMemoryBus() *InMemoryBus
func (*InMemoryBus) Subscribe ¶
func (b *InMemoryBus) Subscribe(eventName string, handler Handler)
type NotificationQueued ¶
func (NotificationQueued) Name ¶
func (e NotificationQueued) Name() string
func (NotificationQueued) Version ¶
func (e NotificationQueued) Version() int
type TenantProvisioned ¶
func (TenantProvisioned) Name ¶
func (e TenantProvisioned) Name() string
func (TenantProvisioned) Version ¶
func (e TenantProvisioned) Version() int
type UserCreated ¶
func (UserCreated) Name ¶
func (e UserCreated) Name() string
func (UserCreated) Version ¶
func (e UserCreated) Version() int
Click to show internal directories.
Click to hide internal directories.