entities

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: 7 Imported by: 0

Documentation

Overview

Package entities contains datastore entity kinds.

Index

Constants

View Source
const (
	// DUTKind is the datastore entity kind for DUT entities.
	DUTKind string = "DUT"
	// DroneKind is the datastore entity kind for drone entities.
	DroneKind string = "Drone"

	// AssignedDroneField is a field name for queries.
	AssignedDroneField = "AssignedDrone"
	// DrainingField is a field name for queries.
	DrainingField = "Draining"
	// HiveField is a field name for queries. It indicates a "zone"
	// that DUTs belong to, which controls which drones a DUT
	// will be assigned to.
	HiveField = "Hive"
)

Variables

This section is empty.

Functions

func DUTGroupKey

func DUTGroupKey(ctx context.Context) *datastore.Key

DUTGroupKey returns a key to be used for all DUT entities. This is used to form an entity group for DUT queries.

func FormatDUTs

func FormatDUTs(d []*DUT) string

FormatDUTs formats a slice of DUTs as a human readable string.

Types

type DUT

type DUT struct {
	ID            DUTID          `gae:"$id"`
	Group         *datastore.Key `gae:"$parent"`
	AssignedDrone DroneID
	Draining      bool
	Hive          string
	// contains filtered or unexported fields
}

DUT is a datastore entity that tracks a DUT.

func (DUT) Equal

func (d DUT) Equal(v DUT) bool

Equal implements equality.

type DUTID

type DUTID string

DUTID is a DUT ID.

type Drone

type Drone struct {
	ID          DroneID `gae:"$id"`
	Expiration  time.Time
	Description string
	Hive        string
	// contains filtered or unexported fields
}

Drone is a datastore entity that tracks a drone.

func (Drone) Equal

func (d Drone) Equal(v Drone) bool

Equal implements equality.

type DroneID

type DroneID string

DroneID is a drone ID.

Jump to

Keyboard shortcuts

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