Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventHandler ¶
type EventHandler interface {
HandleEvent(context.Context, EventMessage)
}
type EventManager ¶
type EventManager struct {
// contains filtered or unexported fields
}
func NewEventManager ¶
func NewEventManager() *EventManager
func (*EventManager) Publish ¶
func (e *EventManager) Publish(emsg EventMessage)
func (*EventManager) StartListening ¶
func (e *EventManager) StartListening(ctx context.Context, handler EventHandler, serviceName string, onSubscribe func())
func (*EventManager) Subscribe ¶
func (e *EventManager) Subscribe(name string) (uuid.UUID, <-chan EventMessage)
func (*EventManager) Unsubscribe ¶
func (e *EventManager) Unsubscribe(id uuid.UUID, name string)
type EventMessage ¶
type EventMessage struct { Type string Payload interface{} }
Click to show internal directories.
Click to hide internal directories.