queries

package
v0.0.0-...-e560ebb Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2021 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Overview

Package queries contains convenient datastore queries.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssignNewDUTs

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

func CreateNewDrone(ctx context.Context, now time.Time) (entities.DroneID, error)

CreateNewDrone creates a new Drone datastore entity with a unique ID. This function cannot be called in a transaction.

func FreeInvalidDUTs

func FreeInvalidDUTs(ctx context.Context, now time.Time) error

FreeInvalidDUTs unassigns DUTs that are assigned to a missing or expired drone. This function cannot be called in a transaction.

func PruneDrainedDUTs

func PruneDrainedDUTs(ctx context.Context) error

PruneDrainedDUTs deletes DUTs that are draining and not assigned to any drone. This function does not need to be called in a transaction.

func PruneExpiredDrones

func PruneExpiredDrones(ctx context.Context, now time.Time) error

PruneExpiredDrones deletes Drones that have expired. This function cannot be called in a transaction.

Types

This section is empty.

Jump to

Keyboard shortcuts

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