state

package
v0.8.8 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var StateModule = fx.Module("centrum_state", fx.Provide(
	New,
))

Functions

This section is empty.

Types

type State

type State struct {
	Settings   *xsync.MapOf[string, *dispatch.Settings]
	Disponents *xsync.MapOf[string, []*users.UserShort]
	Units      *xsync.MapOf[string, *xsync.MapOf[uint64, *dispatch.Unit]]
	Dispatches *xsync.MapOf[string, *xsync.MapOf[uint64, *dispatch.Dispatch]]

	UserIDToUnitID *xsync.MapOf[int32, uint64]
}

func New added in v0.8.8

func New() *State

func (*State) GetDispatch added in v0.8.8

func (s *State) GetDispatch(job string, id uint64) (*dispatch.Dispatch, bool)

func (*State) GetDispatchesMap added in v0.8.8

func (s *State) GetDispatchesMap(job string) *xsync.MapOf[uint64, *dispatch.Dispatch]

func (*State) GetDisponents added in v0.8.8

func (s *State) GetDisponents(job string) []*users.UserShort

func (*State) GetSettings added in v0.8.8

func (s *State) GetSettings(job string) *dispatch.Settings

func (*State) GetUnit added in v0.8.8

func (s *State) GetUnit(job string, id uint64) (*dispatch.Unit, bool)

func (*State) GetUnitIDForUserID added in v0.8.8

func (s *State) GetUnitIDForUserID(userId int32) (uint64, bool)

func (*State) GetUnitsMap added in v0.8.8

func (s *State) GetUnitsMap(job string) *xsync.MapOf[uint64, *dispatch.Unit]

func (*State) ListDispatches added in v0.8.8

func (s *State) ListDispatches(job string) []*dispatch.Dispatch

func (*State) ListUnits added in v0.8.8

func (s *State) ListUnits(job string) ([]*dispatch.Unit, bool)

Jump to

Keyboard shortcuts

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