Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrEventBusClosed = errors.New("event bus closed") ErrTopicNotFound = errors.New("topic not found") )
Functions ¶
Types ¶
type DataChannel ¶
type DataChannel chan DataEvent
type DataChannelSlice ¶
type DataChannelSlice []DataChannel
type EventBus ¶
type EventBus struct { Topics []string // contains filtered or unexported fields }
func NewEventBus ¶
func (*EventBus) Subscribe ¶
func (eb *EventBus) Subscribe(topic string) DataChannel
Subscribe registra o eventbus em um tópico e retorna o canal onde as informações serão enviadas
func (*EventBus) Unsubscribe ¶
Unsubscribe remove o tópico da lista de registrados, fecha todos os canais relacionados a esse tópico
Click to show internal directories.
Click to hide internal directories.