Documentation
¶
Index ¶
- type DB
- func (db *DB) Close() error
- func (db *DB) DeleteDevice(ip string) error
- func (db *DB) DeleteOldDevices(olderThan time.Duration) error
- func (db *DB) GetDeviceCount() (int, error)
- func (db *DB) GetSSHDeviceCount() (int, error)
- func (db *DB) LoadDevices() ([]scanner.Device, error)
- func (db *DB) LoadRecentDevices(since time.Duration) ([]scanner.Device, error)
- func (db *DB) LoadSetting(key string) (string, error)
- func (db *DB) SaveDevice(device scanner.Device) error
- func (db *DB) SaveDevices(devices []scanner.Device) error
- func (db *DB) SaveSetting(key, value string) error
- func (db *DB) UpdateDeviceConnection(ip string, connected bool) error
- func (db *DB) UpdateDeviceCredentials(ip, username, password string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
func (*DB) DeleteDevice ¶ added in v1.0.2
DeleteDevice deletes a specific device by IP address
func (*DB) DeleteOldDevices ¶
DeleteOldDevices removes devices not seen for the specified duration
func (*DB) GetDeviceCount ¶
GetDeviceCount returns the total number of devices in the database
func (*DB) GetSSHDeviceCount ¶
GetSSHDeviceCount returns the number of devices with SSH enabled
func (*DB) LoadDevices ¶
LoadDevices loads all devices from the database
func (*DB) LoadRecentDevices ¶
LoadRecentDevices loads devices seen within the last specified duration
func (*DB) LoadSetting ¶
LoadSetting loads an application setting
func (*DB) SaveDevice ¶
SaveDevice saves or updates a device in the database
func (*DB) SaveDevices ¶
SaveDevices saves multiple devices in a transaction
func (*DB) SaveSetting ¶
SaveSetting saves an application setting
func (*DB) UpdateDeviceConnection ¶
UpdateDeviceConnection updates only the connection status of a device
func (*DB) UpdateDeviceCredentials ¶
UpdateDeviceCredentials updates username and password for a device