Documentation ¶
Index ¶
- type Device
- type DeviceIdentifier
- type DeviceManager
- type DeviceStorage
- func (s *DeviceStorage) AddDeviceIfUnknown(device *Device) error
- func (s *DeviceStorage) Close()
- func (s *DeviceStorage) DeleteDevice(mac string) error
- func (s *DeviceStorage) GetAllDevices() ([]Device, error)
- func (s *DeviceStorage) GetDeviceByID(id string) (*Device, error)
- func (s *DeviceStorage) GetDeviceByIdentifier(identifier string) (*Device, error)
- func (s *DeviceStorage) GetDeviceByMAC(mac string) (*Device, error)
- func (s *DeviceStorage) GetDeviceByManufacturerAndID(manufacturer, id string) (*Device, error)
- func (s *DeviceStorage) GetDeviceByName(name string) (*Device, error)
- func (s *DeviceStorage) UpdateDevice(device Device) error
- func (s *DeviceStorage) UpsertDevice(device *Device) error
- type IdentifyDeviceFromZeroConfEntry
- type InitializeDeviceFromZeroConfEntry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Device ¶
type Device struct { DeviceIdentifier // The Ethernet hardware address of the device, globally unique & assigned by the manufacturer MAC net.HardwareAddr `db:"mac" json:"mac"` // The host address of the device (Host address or resolvable hostname), assigned on this network Host string `db:"host" json:"host"` // The local unique name of the device, defined by the user Name string `db:"name" json:"name"` Info string `db:"info"` Config string `db:"config"` Status string `db:"status"` }
type DeviceIdentifier ¶
type DeviceManager ¶
type DeviceManager struct {
// contains filtered or unexported fields
}
func NewDeviceManager ¶
func NewDeviceManager(log logr.Logger, storage *DeviceStorage) *DeviceManager
func (*DeviceManager) DiscoverDevices ¶
func (dm *DeviceManager) DiscoverDevices(service string, interval time.Duration, identify IdentifyDeviceFromZeroConfEntry, init InitializeDeviceFromZeroConfEntry)
func (*DeviceManager) StopDiscovery ¶
func (dm *DeviceManager) StopDiscovery()
type DeviceStorage ¶
type DeviceStorage struct {
// contains filtered or unexported fields
}
func NewDeviceStorage ¶
func NewDeviceStorage(log logr.Logger, dbName string) (*DeviceStorage, error)
func (*DeviceStorage) AddDeviceIfUnknown ¶
func (s *DeviceStorage) AddDeviceIfUnknown(device *Device) error
func (*DeviceStorage) Close ¶
func (s *DeviceStorage) Close()
func (*DeviceStorage) DeleteDevice ¶
func (s *DeviceStorage) DeleteDevice(mac string) error
func (*DeviceStorage) GetAllDevices ¶
func (s *DeviceStorage) GetAllDevices() ([]Device, error)
func (*DeviceStorage) GetDeviceByID ¶
func (s *DeviceStorage) GetDeviceByID(id string) (*Device, error)
func (*DeviceStorage) GetDeviceByIdentifier ¶
func (s *DeviceStorage) GetDeviceByIdentifier(identifier string) (*Device, error)
func (*DeviceStorage) GetDeviceByMAC ¶
func (s *DeviceStorage) GetDeviceByMAC(mac string) (*Device, error)
func (*DeviceStorage) GetDeviceByManufacturerAndID ¶
func (s *DeviceStorage) GetDeviceByManufacturerAndID(manufacturer, id string) (*Device, error)
func (*DeviceStorage) GetDeviceByName ¶
func (s *DeviceStorage) GetDeviceByName(name string) (*Device, error)
func (*DeviceStorage) UpdateDevice ¶
func (s *DeviceStorage) UpdateDevice(device Device) error
func (*DeviceStorage) UpsertDevice ¶
func (s *DeviceStorage) UpsertDevice(device *Device) error
type IdentifyDeviceFromZeroConfEntry ¶
type IdentifyDeviceFromZeroConfEntry func(log logr.Logger, entry *zeroconf.ServiceEntry) (*DeviceIdentifier, error)
type InitializeDeviceFromZeroConfEntry ¶
type InitializeDeviceFromZeroConfEntry func(log logr.Logger, entry *zeroconf.ServiceEntry) (*Device, error)
function type that knows how to mak a zerofon entry into a device
Click to show internal directories.
Click to hide internal directories.