Documentation ¶
Index ¶
- type ClientDevices
- type Device
- type Devices
- type SqlLiteDevices
- func (s *SqlLiteDevices) AddDevice(newDevice Device) error
- func (s *SqlLiteDevices) FindDeviceByName(device_name string) (Device, error)
- func (s *SqlLiteDevices) GetAllDevices() (Devices, error)
- func (s *SqlLiteDevices) RemoveDeviceByName(device_name string) error
- func (s *SqlLiteDevices) UpdateDevice(device Device) error
- type SqlLiteOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientDevices ¶
type ClientDevices interface { AddDevice(newDevice Device) error UpdateDevice(device Device) error FindDeviceByName(name string) (Device, error) RemoveDeviceByName(name string) error GetAllDevices() (Devices, error) }
ClientDevice interface to interacting with IoT Devices
func NewSqlLiteClient ¶
func NewSqlLiteClient(options SqlLiteOptions) (ClientDevices, error)
NewClient will initialize the Database and return the client
type Device ¶
type Device struct { Name string `json:"name"` Platform string `json:"platform"` Mac string `json:"mac_address"` Ip string `json:"ip_address"` }
Device represents a single IoT Device or Asset in the field
type SqlLiteDevices ¶
type SqlLiteDevices struct {
// contains filtered or unexported fields
}
SqlLiteDevicesLib implements the ClientDevice interface
func (*SqlLiteDevices) AddDevice ¶
func (s *SqlLiteDevices) AddDevice(newDevice Device) error
AddDevice - Insert into table
func (*SqlLiteDevices) FindDeviceByName ¶
func (s *SqlLiteDevices) FindDeviceByName(device_name string) (Device, error)
FindDeviceByName - find a device by its nickname
func (*SqlLiteDevices) GetAllDevices ¶
func (s *SqlLiteDevices) GetAllDevices() (Devices, error)
GetAllDevices - get all registered devices
func (*SqlLiteDevices) RemoveDeviceByName ¶
func (s *SqlLiteDevices) RemoveDeviceByName(device_name string) error
RemoveDeviceByName - remove device given its nickname
func (*SqlLiteDevices) UpdateDevice ¶
func (s *SqlLiteDevices) UpdateDevice(device Device) error
UpdateDevice - update information on a specific device
type SqlLiteOptions ¶
type SqlLiteOptions struct {
// contains filtered or unexported fields
}
func NewSqlLiteDefaultOptions ¶
func NewSqlLiteDefaultOptions() SqlLiteOptions
Click to show internal directories.
Click to hide internal directories.