state

package
v0.8.20 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func JobIdKey added in v0.8.13

func JobIdKey(job string, id uint64) string

Types

type Params added in v0.8.14

type Params struct {
	fx.In

	LC fx.Lifecycle

	Logger *zap.Logger
	JS     nats.JetStreamContext
	Config *config.Config
}

type State

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

func New added in v0.8.8

func New(p Params) (*State, error)

func (*State) CreateDispatch added in v0.8.20

func (s *State) CreateDispatch(ctx context.Context, job string, id uint64, dsp *centrum.Dispatch) error

func (*State) DeleteDispatch added in v0.8.11

func (s *State) DeleteDispatch(job string, id uint64) error

func (*State) DeleteUnit added in v0.8.11

func (s *State) DeleteUnit(job string, id uint64) error

func (*State) DispatchesStore added in v0.8.13

func (s *State) DispatchesStore() *store.Store[centrum.Dispatch, *centrum.Dispatch]

func (*State) FilterDispatches added in v0.8.9

func (s *State) FilterDispatches(job string, statuses []centrum.StatusDispatch, notStatuses []centrum.StatusDispatch) []*centrum.Dispatch

func (*State) FilterUnits added in v0.8.10

func (s *State) FilterUnits(job string, statuses []centrum.StatusUnit, notStatuses []centrum.StatusUnit, filterFn func(unit *centrum.Unit) bool) []*centrum.Unit

func (*State) GetDispatch added in v0.8.8

func (s *State) GetDispatch(job string, id uint64) (*centrum.Dispatch, error)

func (*State) GetDispatchLocations added in v0.8.11

func (s *State) GetDispatchLocations(job string) *coords.Coords[*centrum.Dispatch]

func (*State) GetDisponents added in v0.8.8

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

func (*State) GetSettings added in v0.8.8

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

func (*State) GetUnit added in v0.8.8

func (s *State) GetUnit(job string, id uint64) (*centrum.Unit, error)

func (*State) GetUserUnitID added in v0.8.11

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

func (*State) ListDispatches added in v0.8.8

func (s *State) ListDispatches(job string) ([]*centrum.Dispatch, bool)

func (*State) ListSettings added in v0.8.11

func (s *State) ListSettings() []*centrum.Settings

func (*State) ListUnits added in v0.8.8

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

func (*State) SetUnitForUser added in v0.8.11

func (s *State) SetUnitForUser(job string, userId int32, unitId uint64) error

func (*State) UnitsStore added in v0.8.13

func (s *State) UnitsStore() *store.Store[centrum.Unit, *centrum.Unit]

func (*State) UnsetUnitIDForUser added in v0.8.11

func (s *State) UnsetUnitIDForUser(userId int32) error

func (*State) UpdateDispatch added in v0.8.11

func (s *State) UpdateDispatch(ctx context.Context, job string, id uint64, dsp *centrum.Dispatch) error

func (*State) UpdateDispatchStatus added in v0.8.13

func (s *State) UpdateDispatchStatus(ctx context.Context, job string, id uint64, status *centrum.DispatchStatus) error

func (*State) UpdateDispatchUnits added in v0.8.13

func (s *State) UpdateDispatchUnits(ctx context.Context, job string, id uint64, units []*centrum.DispatchAssignment) error

func (*State) UpdateDisponents added in v0.8.11

func (s *State) UpdateDisponents(job string, disponents []*users.UserShort) error

func (*State) UpdateSettings added in v0.8.11

func (s *State) UpdateSettings(job string, in *centrum.Settings) error

func (*State) UpdateUnit added in v0.8.11

func (s *State) UpdateUnit(ctx context.Context, job string, id uint64, unit *centrum.Unit) error

func (*State) UpdateUnitStatus added in v0.8.13

func (s *State) UpdateUnitStatus(ctx context.Context, job string, id uint64, status *centrum.UnitStatus) error

func (*State) UpdateUnitUsers added in v0.8.13

func (s *State) UpdateUnitUsers(ctx context.Context, job string, id uint64, users []*centrum.UnitAssignment) error

Jump to

Keyboard shortcuts

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