Documentation ¶
Overview ¶
Package queries contains convenient datastore queries.
Index ¶
- func AssignNewDUTs(ctx context.Context, d entities.DroneID, ...) ([]*entities.DUT, error)
- func CreateNewDrone(ctx context.Context, now time.Time) (entities.DroneID, error)
- func FreeInvalidDUTs(ctx context.Context, now time.Time) error
- func PruneDrainedDUTs(ctx context.Context) error
- func PruneExpiredDrones(ctx context.Context, now time.Time) 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) ([]*entities.DUT, 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.