This section is empty.


This section is empty.


func FlushDatastore

func FlushDatastore(ctx context.Context, changes Changes) error

    FlushDatastore deletes changes dumped to bigquery from datastore.

    func Use

    func Use(ctx context.Context, reason string) context.Context

      Use installs the value of change reason to context.


      type Change

      type Change struct {
      	ID          int64     `gae:"$id"`
      	DeviceID    string    `gae:",noindex"`
      	Hostname    string    `gae:",noindex"`
      	Label       string    `gae:",noindex"`
      	OldValue    string    `gae:",noindex"`
      	NewValue    string    `gae:",noindex"`
      	Updated     time.Time `gae:",noindex"`
      	ByWhomName  string    `gae:",noindex"`
      	ByWhomEmail string    `gae:",noindex"`
      	Comment     string    `gae:",noindex"`
      	// contains filtered or unexported fields

        Change tracks the change of a ChromeOSDevice.

        type Changes

        type Changes []Change

          Changes is a slice of Change.

          func LoadFromDatastore

          func LoadFromDatastore(ctx context.Context) (Changes, error)

            LoadFromDatastore loads all Changes entities from datastore.

            func LogChromeOSDeviceChanges

            func LogChromeOSDeviceChanges(old *lab.ChromeOSDevice, newData *lab.ChromeOSDevice) (changes Changes)

              LogChromeOSDeviceChanges logs the change of the given ChromeOSDevice.

              func LogChromeOSLabstationChange

              func LogChromeOSLabstationChange(old *lab.ChromeOSDevice, newData *lab.ChromeOSDevice) (changes Changes)

                LogChromeOSLabstationChange logs the change of the given labstation

                func LogDutStateChanges

                func LogDutStateChanges(hostname string, old *lab.DutState, newData *lab.DutState) (changes Changes)

                  LogDutStateChanges logs the change of the given DutState.

                  func (*Changes) LogDecommission

                  func (c *Changes) LogDecommission(id, hostname string)

                    LogDecommission logs the decommission of a ChromeOSDevice.

                    func (*Changes) LogDeployment

                    func (c *Changes) LogDeployment(id, hostname string)

                      LogDeployment logs the deployment of a ChromeOSDevice.

                      func (Changes) SaveToDatastore

                      func (c Changes) SaveToDatastore(ctx context.Context) error

                        SaveToDatastore saves the changes to datastore.

                        type LifeCycleEvent

                        type LifeCycleEvent string

                          LifeCycleEvent is the type for all life cycle events, e.g. deployment, decommission, etc.

                          const (
                          	// DatastoreKind is the datastore kind.
                          	DatastoreKind = "ChangeHistory"
                          	// LifeCycleDeployment indicates the deployment of a device.
                          	LifeCycleDeployment LifeCycleEvent = "DEPLOYMENT"
                          	// LifeCycleDecomm indicates the decommission of a device.
                          	LifeCycleDecomm LifeCycleEvent = "DECOMMISSION"

                          Source Files