Documentation ¶
Index ¶
- Constants
- type ITracker
- type Manager
- type ManagerParams
- type Params
- type TestParams
- type TestTracker
- func (s *TestTracker) GetAllActiveUsers() ([]*livemap.UserMarker, error)
- func (s *TestTracker) GetUserById(id int32) (*livemap.UserMarker, bool)
- func (s *TestTracker) GetUserByJobAndID(job string, userId int32) (*livemap.UserMarker, bool)
- func (s *TestTracker) GetUsersByJob(job string) (*xsync.MapOf[int32, *livemap.UserMarker], bool)
- func (s *TestTracker) IsUserOnDuty(userId int32) bool
- func (s *TestTracker) Subscribe() chan *livemap.UsersUpdateEvent
- func (s *TestTracker) Unsubscribe(c chan *livemap.UsersUpdateEvent)
- type Tracker
- func (s *Tracker) GetAllActiveUsers() ([]*livemap.UserMarker, error)
- func (s *Tracker) GetUserById(id int32) (*livemap.UserMarker, bool)
- func (s *Tracker) GetUsersByJob(job string) (*xsync.MapOf[int32, *livemap.UserMarker], bool)
- func (s *Tracker) IsUserOnDuty(userId int32) bool
- func (s *Tracker) Subscribe() chan *livemap.UsersUpdateEvent
- func (s *Tracker) Unsubscribe(c chan *livemap.UsersUpdateEvent)
Constants ¶
View Source
const ( StreamName = "TRACKER" BaseSubject events.Subject = "tracker" UsersUpdate events.Type = "users_update" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ITracker ¶
type ITracker interface { GetUsersByJob(job string) (*xsync.MapOf[int32, *livemap.UserMarker], bool) GetUserById(id int32) (*livemap.UserMarker, bool) GetAllActiveUsers() ([]*livemap.UserMarker, error) IsUserOnDuty(userId int32) bool Subscribe() chan *livemap.UsersUpdateEvent Unsubscribe(c chan *livemap.UsersUpdateEvent) }
func NewForTests ¶
func NewForTests(p TestParams) ITracker
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func NewManager(p ManagerParams) (*Manager, error)
type ManagerParams ¶
type TestTracker ¶
type TestTracker struct { ITracker // contains filtered or unexported fields }
func (*TestTracker) GetAllActiveUsers ¶
func (s *TestTracker) GetAllActiveUsers() ([]*livemap.UserMarker, error)
func (*TestTracker) GetUserById ¶
func (s *TestTracker) GetUserById(id int32) (*livemap.UserMarker, bool)
func (*TestTracker) GetUserByJobAndID ¶
func (s *TestTracker) GetUserByJobAndID(job string, userId int32) (*livemap.UserMarker, bool)
func (*TestTracker) GetUsersByJob ¶
func (s *TestTracker) GetUsersByJob(job string) (*xsync.MapOf[int32, *livemap.UserMarker], bool)
func (*TestTracker) IsUserOnDuty ¶
func (s *TestTracker) IsUserOnDuty(userId int32) bool
func (*TestTracker) Subscribe ¶
func (s *TestTracker) Subscribe() chan *livemap.UsersUpdateEvent
func (*TestTracker) Unsubscribe ¶
func (s *TestTracker) Unsubscribe(c chan *livemap.UsersUpdateEvent)
type Tracker ¶
type Tracker struct { ITracker // contains filtered or unexported fields }
func (*Tracker) GetAllActiveUsers ¶
func (s *Tracker) GetAllActiveUsers() ([]*livemap.UserMarker, error)
func (*Tracker) GetUserById ¶
func (s *Tracker) GetUserById(id int32) (*livemap.UserMarker, bool)
func (*Tracker) GetUsersByJob ¶
func (*Tracker) IsUserOnDuty ¶
func (*Tracker) Subscribe ¶
func (s *Tracker) Subscribe() chan *livemap.UsersUpdateEvent
func (*Tracker) Unsubscribe ¶
func (s *Tracker) Unsubscribe(c chan *livemap.UsersUpdateEvent)
Click to show internal directories.
Click to hide internal directories.