// device is a product instance, which is managed by our platform package models import "github.com/jinzhu/gorm" // Device device model type Device struct { gorm.Model // which product the device belongs to ProductID int32 // universal device identifier, generated from vendorid-productid-deviceserial DeviceIdentifier string `sql:"type:varchar(200);not null;unique;key"` // device secret which is auto generated by the platform DeviceSecret string `sql:"type:varchar(200);not null;"` // device key is used to auth a device DeviceKey string `sql:"type:varchar(200);not null;key;"` // device name DeviceName string `sql:"type:varchar(200);not null;"` // device desc DeviceDescription string `sql:"type:text;not null;"` // device version(the agent version) DeviceVersion string `sql:"type:text;not null;"` }