models

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DeviceTypeUnknown   = udetect.DeviceTypeUnknown
	DeviceTypeMobile    = udetect.DeviceTypeMobile    // Mobile/Tablet
	DeviceTypePC        = udetect.DeviceTypePC        // Desktop
	DeviceTypeTV        = udetect.DeviceTypeTV        // TV
	DeviceTypePhone     = udetect.DeviceTypePhone     // SmartPhone, SmallScreen
	DeviceTypeTablet    = udetect.DeviceTypeTablet    // Tablet
	DeviceTypeConnected = udetect.DeviceTypeConnected // Console, EReader, Watch
	DeviceTypeSetTopBox = udetect.DeviceTypeSetTopBox // MediaHub
	DeviceTypeWatch     = udetect.DeviceTypeWatch     // SmartWatch
	DeviceTypeGlasses   = udetect.DeviceTypeGlasses   // Glasses
	DeviceTypeOOH       = udetect.DeviceTypeOOH       // Out of Home
)

Device set of types

Variables

View Source
var DeviceTypeList = []*DeviceType{
	{ID: uint64(DeviceTypeUnknown), Codename: "unknown", Name: "Unknown", Description: "Unknown device type", Active: types.StatusActive},
	{ID: uint64(DeviceTypeMobile), Codename: "mobile", Name: "Mobile", Description: "Mobile device", Active: types.StatusActive},
	{ID: uint64(DeviceTypePC), Codename: "pc", Name: "PC", Description: "Personal Computer", Active: types.StatusActive},
	{ID: uint64(DeviceTypeTV), Codename: "tv", Name: "TV", Description: "TV device", Active: types.StatusActive},
	{ID: uint64(DeviceTypePhone), Codename: "phone", Name: "Phone", Description: "Phone device", Active: types.StatusActive},
	{ID: uint64(DeviceTypeTablet), Codename: "tablet", Name: "Tablet", Description: "Tablet device", Active: types.StatusActive},
	{ID: uint64(DeviceTypeConnected), Codename: "connected", Name: "Connected", Description: "Connected device (Console, EReader)", Active: types.StatusActive},
	{ID: uint64(DeviceTypeSetTopBox), Codename: "settopbox", Name: "SetTopBox", Description: "SetTopBox device", Active: types.StatusActive},
	{ID: uint64(DeviceTypeWatch), Codename: "watch", Name: "Watch", Description: "Watch device", Active: types.StatusActive},
	{ID: uint64(DeviceTypeGlasses), Codename: "glasses", Name: "Glasses", Description: "Glasses device", Active: types.StatusActive},
	{ID: uint64(DeviceTypeOOH), Codename: "ooh", Name: "OOH", Description: "Out of Home device", Active: types.StatusActive},
}

DeviceTypeList is a list of DeviceType

Functions

This section is empty.

Types

type DeviceMaker

type DeviceMaker struct {
	ID          uint64 `json:"id" gorm:"primaryKey"`
	Codename    string `json:"codename" gorm:"unique"`
	Name        string `json:"name"`
	Description string `json:"description"`

	// "github.com/IGLOU-EU/go-wildcard/v2" package syntax
	MatchExp string `json:"match_exp,omitempty"`

	Active types.ActiveStatus `gorm:"type:ActiveStatus" json:"active,omitempty"`

	Models []*DeviceModel `json:"models,omitempty" gorm:"foreignKey:MakerCodename;references:Codename"`

	// Time marks
	CreatedAt time.Time      `json:"created_at"`
	UpdatedAt time.Time      `json:"updated_at"`
	DeletedAt gorm.DeletedAt `json:"deleted_at,omitempty"`
}

DeviceMaker model

func (*DeviceMaker) RBACResourceName

func (m *DeviceMaker) RBACResourceName() string

RBACResourceName returns the name of the resource for the RBAC

func (*DeviceMaker) TableName

func (m *DeviceMaker) TableName() string

TableName in database

type DeviceModel

type DeviceModel struct {
	ID          uint64 `json:"id" gorm:"primaryKey"`
	Codename    string `json:"codename" gorm:"unique"`
	Name        string `json:"name"`
	Description string `json:"description"`

	ParentID uint64       `json:"parent_id,omitempty"`
	Parent   *DeviceModel `json:"parent,omitempty" gorm:"foreignKey:ParentID;references:ID"`

	YearRelease int `json:"year_release,omitempty"`

	Active types.ActiveStatus `gorm:"type:ActiveStatus" json:"active,omitempty"`

	MatchExp string `json:"match_exp,omitempty"`

	// Link to device maker
	MakerCodename string       `json:"maker_codename,omitempty"`
	Maker         *DeviceMaker `json:"maker,omitempty" gorm:"foreignKey:MakerCodename;references:Codename"`

	// Device type
	TypeCodename string      `json:"type_codename,omitempty"`
	Type         *DeviceType `json:"type,omitempty" gorm:"foreignKey:TypeCodename;references:Codename"`

	// Versions of the model
	Versions []*DeviceModel `json:"versions,omitempty" gorm:"foreignKey:ParentID;references:ID"`

	// Time marks
	CreatedAt time.Time      `json:"created_at"`
	UpdatedAt time.Time      `json:"updated_at"`
	DeletedAt gorm.DeletedAt `json:"deleted_at,omitempty"`
}

DeviceModel model

func (*DeviceModel) RBACResourceName

func (m *DeviceModel) RBACResourceName() string

RBACResourceName returns the name of the resource for the RBAC

func (*DeviceModel) TableName

func (m *DeviceModel) TableName() string

TableName in database

type DeviceType

type DeviceType struct {
	ID          uint64 `json:"id" gorm:"primaryKey"`
	Codename    string `json:"codename" gorm:"unique"`
	Name        string `json:"name"`
	Description string `json:"description"`

	Active types.ActiveStatus `gorm:"type:ActiveStatus" json:"active,omitempty"`

	// Time marks
	CreatedAt time.Time      `json:"created_at"`
	UpdatedAt time.Time      `json:"updated_at"`
	DeletedAt gorm.DeletedAt `json:"deleted_at,omitempty"`
}

DeviceType model

func (*DeviceType) RBACResourceName

func (m *DeviceType) RBACResourceName() string

RBACResourceName returns the name of the resource for the RBAC

func (*DeviceType) TableName

func (m *DeviceType) TableName() string

TableName in database

Jump to

Keyboard shortcuts

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