Documentation
¶
Index ¶
- func FilterPassAlways(e events.Event) bool
- func FilterPassLogoutEvents(e events.Event) bool
- type EventChan
- type FilterPass
- type Pool
- func (p *Pool) CreateChan(filter FilterPass) <-chan events.Event
- func (p *Pool) CreateChanNoFilter() <-chan events.Event
- func (p *Pool) GetInputChan() chan<- events.Event
- func (p *Pool) GetUserChan(username string) <-chan events.Event
- func (p *Pool) Run()
- func (p *Pool) WithUserChFilter(f func(username string) FilterPass) *Pool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FilterPassAlways ¶
FilterPassAlways event is always passable
func FilterPassLogoutEvents ¶
FilterPassLogoutEvents passes only LogoutEvents
Types ¶
type EventChan ¶
type EventChan struct { Ch chan events.Event // should return true if event should pass into channel Filter FilterPass }
EventChan is used to determine if event can pass into channel custome FilterPass can be assigned, which returns true if event is passable
func (*EventChan) WithFilter ¶
func (ec *EventChan) WithFilter(filter FilterPass) *EventChan
WithFilter ...
type FilterPass ¶
FilterPass should return true if event is passable
func FilterPassIfUserInChat ¶
func FilterPassIfUserInChat(chatDB db.ChatDB, username string) FilterPass
FilterPassIfUserInChat event is passable only if user is in same chat as event occurs in or if event global
type Pool ¶
Pool ...
func (*Pool) CreateChan ¶
func (p *Pool) CreateChan(filter FilterPass) <-chan events.Event
CreateChan creates chan with filter
func (*Pool) CreateChanNoFilter ¶
CreateChanNoFilter creates chan with no filter
func (*Pool) GetUserChan ¶
GetUserChan gets chan for user chans are created with default filter events.FilterPassIfUserInChat
func (*Pool) WithUserChFilter ¶
func (p *Pool) WithUserChFilter(f func(username string) FilterPass) *Pool
WithUserChFilter ...
Click to show internal directories.
Click to hide internal directories.