data

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// DeviceList holds the list of discovered devices
	DeviceList binding.UntypedList

	// ScanProgress holds the current scan progress message
	ScanProgress binding.String

	// IsScanning indicates if a scan is currently running
	IsScanning binding.Bool

	// Database instance
	DB *database.DB
)

Global data bindings

Functions

func AddDevice

func AddDevice(device scanner.Device)

AddDevice adds a new device to the global device list and saves to database

func ClearDevices

func ClearDevices()

ClearDevices removes all devices from the list (does not clear database)

func ClearDevicesAndDB

func ClearDevicesAndDB()

ClearDevicesAndDB removes all devices from list and database

func Close

func Close()

Close closes the database connection

func GetDeviceByIP

func GetDeviceByIP(ip string) (scanner.Device, int, bool)

GetDeviceByIP finds a device by IP address

func GetDevices

func GetDevices() []scanner.Device

GetDevices returns all devices as a slice

func Init

func Init()

Initialize all global bindings and database

func InitDatabase

func InitDatabase()

InitDatabase initializes the database after the main app has started

func LoadDevicesFromDB

func LoadDevicesFromDB()

LoadDevicesFromDB loads devices from database and adds them to the device list

func LoadDevicesFromDBWithCallback added in v1.0.2

func LoadDevicesFromDBWithCallback(callback func())

LoadDevicesFromDBWithCallback loads devices from database and calls the callback after loading

func LoadRecentDevicesFromDB

func LoadRecentDevicesFromDB(since time.Duration)

LoadRecentDevicesFromDB loads only recently seen devices from database

func LoadSetting

func LoadSetting(key string) string

LoadSetting loads an application setting from database

func SaveDevicesToDB

func SaveDevicesToDB()

SaveDevicesToDB saves all current devices to database

func SaveSetting

func SaveSetting(key, value string)

SaveSetting saves an application setting to database

func SetScanProgress

func SetScanProgress(message string)

SetScanProgress updates the scan progress message

func SetScanning

func SetScanning(scanning bool)

SetScanning updates the scanning status

func UpdateDevice

func UpdateDevice(index int, device scanner.Device)

UpdateDevice updates a device both in memory and database

func UpdateDeviceConnection

func UpdateDeviceConnection(index int, connected bool)

UpdateDeviceConnection updates device connection status both in memory and database

func UpdateDeviceCredentials

func UpdateDeviceCredentials(index int, username, password string)

UpdateDeviceCredentials updates device credentials both in memory and database

Types

This section is empty.

Jump to

Keyboard shortcuts

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