tests

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDeviceModel

func NewDeviceModel(db *gorm.DB) *gomodel.Model[*Device]

func NewDeviceScanModel

func NewDeviceScanModel(db *gorm.DB) *gomodel.Model[*DeviceScan]

func NewTestDatabase

func NewTestDatabase()

Types

type Device

type Device struct {
	Id           int64           `gorm:"primaryKey;autoIncrement:false"`
	SerialNumber string          `gorm:""`
	PublicKey    string          `json:"public_key"`
	Algorithm    string          `json:"algorithm"`
	DeletedAt    *gorm.DeletedAt `json:"deleted_at"`
	Scans        []DeviceScan    `json:"scans"`
}

func (*Device) GetId

func (d *Device) GetId() int64

func (*Device) Query

func (d *Device) Query(db *gorm.DB, withTrash bool) *gorm.DB

func (*Device) SetId

func (d *Device) SetId(id int64)

type DeviceScan

type DeviceScan struct {
	Id       int64  `gorm:"primaryKey;autoIncrement:false"`
	DeviceId int64  `json:"device_id"`
	Device   Device `json:"device"`
	Rssi     int    `json:"rssi"`
}

func (*DeviceScan) GetId

func (d *DeviceScan) GetId() int64

func (*DeviceScan) Query

func (d *DeviceScan) Query(db *gorm.DB, withTrash bool) *gorm.DB

func (*DeviceScan) SetId

func (d *DeviceScan) SetId(id int64)

Jump to

Keyboard shortcuts

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