Documentation
¶
Overview ¶
Package queries contains convenient datastore queries.
Index ¶
- func AssignNewDUTs(ctx context.Context, d entities.DroneID, ...) (_ []*entities.DUT, err error)
- func CreateNewDrone(ctx context.Context, now time.Time) (_ entities.DroneID, err error)
- func FreeInvalidDUTs(ctx context.Context, now time.Time) (err error)
- func PruneDrainedDUTs(ctx context.Context) (err error)
- func PruneExpiredDrones(ctx context.Context, now time.Time) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssignNewDUTs ¶
func AssignNewDUTs(ctx context.Context, d entities.DroneID, li *api.ReportDroneRequest_LoadIndicators, hive string, version string) (_ []*entities.DUT, err error)
AssignNewDUTs assigns new DUTs to the drone according to its load indicators and current DUTs. Returns the list of all DUTs assigned to the drone. hive is the zone/hive the DUT/Drone belongs to.
This function needs to be run within a datastore transaction.
func CreateNewDrone ¶
CreateNewDrone creates a new Drone datastore entity with a unique ID. This function cannot be called in a transaction.
func FreeInvalidDUTs ¶
FreeInvalidDUTs unassigns DUTs that are assigned to a missing or expired drone. This function cannot be called in a transaction.
func PruneDrainedDUTs ¶
PruneDrainedDUTs deletes DUTs that are draining and not assigned to any drone. This function does not need to be called in a transaction.
Types ¶
This section is empty.