tracker

package
v0.8.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 31, 2023 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxDispatchMarkerLimit = 120
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	Added   []*UserInfo
	Removed []*UserInfo
	Current []*UserInfo
}

type Params

type Params struct {
	fx.In

	LC fx.Lifecycle

	Logger   *zap.Logger
	TP       *tracesdk.TracerProvider
	DB       *sql.DB
	Enricher *mstlystcdata.Enricher
	Postals  *postals.Postals
	Config   *config.Config
	State    *state.State
}

type Tracker

type Tracker struct {
	// contains filtered or unexported fields
}

func New

func New(p Params) *Tracker

func (*Tracker) GenerateRandomDispatchMarker

func (s *Tracker) GenerateRandomDispatchMarker()

func (*Tracker) GenerateRandomUserMarker

func (s *Tracker) GenerateRandomUserMarker()

func (*Tracker) GetUserById

func (s *Tracker) GetUserById(id int32) (*livemap.UserMarker, bool)

func (*Tracker) GetUserByJobAndID

func (s *Tracker) GetUserByJobAndID(job string, userId int32) (*livemap.UserMarker, bool)

func (*Tracker) GetUsers

func (s *Tracker) GetUsers(job string) (*xsync.MapOf[int32, *livemap.UserMarker], bool)

func (*Tracker) IsUserOnDuty

func (s *Tracker) IsUserOnDuty(job string, userId int32) bool

func (*Tracker) Subscribe

func (s *Tracker) Subscribe() chan *Event

func (*Tracker) Unsubscribe

func (s *Tracker) Unsubscribe(c chan *Event)

type UserInfo added in v0.8.5

type UserInfo struct {
	Job    string
	UserID int32
	Time   time.Time
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL