datastore

package
v0.0.0-...-cc86588 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2019 License: AGPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	ID             int64
	Created        time.Time
	Modified       time.Time
	OrganizationID string
	DeviceID       string
	ActionID       string
	Action         string
	Status         string
	Message        string
}

Action is the log of an action request

type DataStore

type DataStore interface {
	DeviceList(orgID string) ([]Device, error)
	DeviceGet(id string) (Device, error)
	DevicePing(id string, refresh time.Time) error
	DeviceCreate(Device) (int64, error)

	DeviceSnapList(id int64) ([]DeviceSnap, error)
	DeviceSnapDelete(id int64) error
	DeviceSnapUpsert(ds DeviceSnap) error

	ActionCreate(act Action) (int64, error)
	ActionUpdate(actionID, status, message string) error
	ActionListForDevice(orgID, deviceID string) ([]Action, error)

	DeviceVersionGet(deviceID int64) (DeviceVersion, error)
	DeviceVersionUpsert(dv DeviceVersion) error
	DeviceVersionDelete(id int64) error

	GroupCreate(orgID, name string) (int64, error)
	GroupList(orgID string) ([]Group, error)
	GroupGet(orgID, name string) (Group, error)
	GroupLinkDevice(orgID, name, deviceID string) error
	GroupUnlinkDevice(orgID, name, deviceID string) error
	GroupGetDevices(orgID, name string) ([]Device, error)
	GroupGetExcludedDevices(orgID, name string) ([]Device, error)
}

DataStore is the interfaces for the data repository

type Device

type Device struct {
	ID             int64
	Created        time.Time
	LastRefresh    time.Time
	OrganisationID string
	DeviceID       string
	Brand          string
	Model          string
	SerialNumber   string
	DeviceKey      string
	StoreID        string
	Active         bool
}

Device the repository definition of a device

type DeviceSnap

type DeviceSnap struct {
	ID            int
	Created       time.Time
	Modified      time.Time
	DeviceID      int64
	Name          string
	InstalledSize int64
	InstalledDate time.Time
	Status        string
	Channel       string
	Confinement   string
	Version       string
	Revision      int
	Devmode       bool
	Config        string
}

DeviceSnap holds the details of snap on a device

type DeviceVersion

type DeviceVersion struct {
	ID            int64
	DeviceID      int64
	Version       string
	Series        string
	OSID          string
	OSVersionID   string
	OnClassic     bool
	KernelVersion string
}

DeviceVersion holds the details of the OS details on the device

type Group

type Group struct {
	ID             int64
	Created        time.Time
	Modified       time.Time
	OrganisationID string
	Name           string
}

Group is the record for grouping devices

type GroupDeviceLink struct {
	ID             int64
	Created        time.Time
	OrganisationID string
	GroupID        int64
	DeviceID       int64
}

GroupDeviceLink is the record for linking devices to groups

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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