models

package
v0.0.0-...-b374e21 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Device

type Device struct {
	UID              string            `storm:"id" json:"uid"`
	Hardware         string            `json:"hardware"`
	Version          string            `json:"version"`
	ProductUID       string            `json:"product_uid"`
	DeviceIdentity   map[string]string `json:"device_identity"`
	DeviceAttributes map[string]string `json:"device_attributes"`
	Status           string            `json:"status"`
	LastSeen         time.Time         `json:"last_seen"`
}

func (*Device) ActiveRollout

func (d *Device) ActiveRollout(db *storm.DB) (*Rollout, error)

type Package

type Package struct {
	UID               string      `storm:"id" json:"uid"`
	Version           string      `json:"version"`
	SupportedHardware interface{} `json:"supported_hardware"`
	Signature         []byte      `json:"signature"`
	Metadata          []byte      `json:"metadata"`
}

type Report

type Report struct {
	ID        int       `storm:"id,increment" json:"id"`
	Device    string    `storm:"index" json:"device"`
	Rollout   int       `storm:"index" json:"rollout"`
	Status    string    `json:"status"`
	IsError   bool      `json:"error"`
	Message   string    `json:"message"`
	Timestamp time.Time `json:"timestamp"`
	Virtual   bool      `json:"virtual"`
}

type Rollout

type Rollout struct {
	ID         int       `storm:"id,increment" json:"id"`
	Package    string    `storm:"index" json:"package"`
	Devices    []string  `json:"devices"`
	Running    bool      `json:"running"`
	StartedAt  time.Time `json:"started_at"`
	FinishedAt time.Time `json:"finished_at"`
}

func (*Rollout) IsFinished

func (r *Rollout) IsFinished(db *storm.DB) (bool, error)

func (*Rollout) Reports

func (r *Rollout) Reports(db *storm.DB) ([]Report, error)

Jump to

Keyboard shortcuts

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