Documentation ¶
Index ¶
Constants ¶
View Source
const ( EventCoinsPricesFetched = "coins_prices_fetched" EventFoundUnexistingSymbol = "found_unexisting_symbol" SendNotification = "send_notification" SaveBalance = "save_balance" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bus ¶
type Bus struct {
// contains filtered or unexported fields
}
func NewEventBus ¶
func NewEventBus() *Bus
func (*Bus) Subscribe ¶
func (b *Bus) Subscribe(events ...string) *Subscription
type Event ¶
type Event struct { Name string Payload interface{} }
func FoundUnexistingSymbol ¶
func GenerateEvent ¶
type EventHandler ¶
type Subscription ¶
type Subscription struct { EventsCh chan Event EventsSubscribed map[string]bool // contains filtered or unexported fields }
func (*Subscription) Close ¶
func (s *Subscription) Close()
func (*Subscription) Handler ¶
func (s *Subscription) Handler(ctx context.Context, handler EventHandler)
If events is not provided, will be all events for this subscription
Click to show internal directories.
Click to hide internal directories.