Documentation
¶
Index ¶
- Constants
- func NewConfigService(cfg config.IConfiguration) model.IConfigService
- func NewDatabaseService(cfg config.IConfiguration) model.IDatabaseService
- func NewDeviceService(cfg config.IConfiguration, restService model.IRestService, ...) model.IDeviceService
- func NewMqttService() model.IMqttService
- func NewNotificationService(cfg config.IConfiguration) model.INotificationService
- func NewRestService() model.IRestService
- func NewServiceFactory(cfg config.IConfiguration) model.IServiceFactory
- func NewSharedMemory(cfg config.IConfiguration) model.ISharedMemory
- func NewTelegramService(cfg config.IConfiguration) model.ITelegramService
- func NewUserService(cfg config.IConfiguration, databaseService model.IDatabaseService) model.IUserService
- type ConfigService
- type DatabaseService
- type DeviceService
- func (d *DeviceService) DeviceCommand(deviceKey string, params model.Dictionary) bool
- func (d *DeviceService) DeviceGroupCommand(groupKey string, params model.Dictionary) bool
- func (d *DeviceService) DeviceState(deviceKey string) interface{}
- func (d *DeviceService) DeviceStates() model.Dictionary
- func (d *DeviceService) DeviceUpdate(dev *model.Device, oldState string)
- func (d *DeviceService) GetDevice(deviceKey string) (*model.Device, error)
- func (d *DeviceService) GetDevices() (*model.Devices, error)
- func (d *DeviceService) GetDevicesDto(filter model.DeviceFilter) (*model.DevicesDto, error)
- func (d *DeviceService) ReloadDevices() error
- type MqttService
- func (m *MqttService) HandleMessage(topic string, payload []byte)
- func (m *MqttService) Publish(topic string, payload interface{}) bool
- func (m *MqttService) SetClient(client mqtt.Client)
- func (m *MqttService) SetMessageHandler(handler model.MqttMessageHandler)
- func (m *MqttService) Subscribe(topic string) bool
- type NotificationService
- type RestService
- type ServiceFactory
- func (s *ServiceFactory) Finalize()
- func (s *ServiceFactory) GetConfigService() model.IConfigService
- func (s *ServiceFactory) GetDatabaseService() model.IDatabaseService
- func (s *ServiceFactory) GetDeviceService() model.IDeviceService
- func (s *ServiceFactory) GetMqttService() model.IMqttService
- func (s *ServiceFactory) GetNotificationService() model.INotificationService
- func (s *ServiceFactory) GetRestService() model.IRestService
- func (s *ServiceFactory) GetSharedMemory() model.ISharedMemory
- func (s *ServiceFactory) GetTelegramService() model.ITelegramService
- func (s *ServiceFactory) GetUserService() model.IUserService
- type SharedMemory
- func (s *SharedMemory) GetDeviceMem(deviceKey string) interface{}
- func (s *SharedMemory) GetLastUpdated(deviceKey string) int64
- func (s *SharedMemory) GetMem(deviceKey string, key string) interface{}
- func (s *SharedMemory) GetMemory() model.Dictionary
- func (s *SharedMemory) LoadSharedMem()
- func (s *SharedMemory) MarkAsUpdated(deviceKey string)
- func (s *SharedMemory) Persist()
- func (s *SharedMemory) SetMem(deviceKey string, key string, value interface{})
- func (s *SharedMemory) SetNotifyCallback(notifyFunc model.NotifyFunc)
- type TelegramService
- type UserService
Constants ¶
View Source
const KeyLastUpdated = "lastUpdated"
View Source
const KeyPayload = "payload"
View Source
const KeyPayloadOff = "payload_off"
View Source
const KeyPayloadOn = "payload_on"
View Source
const KeyPayloadToggle = "payload_toggle"
View Source
const KeyPowerOff = "power_off"
View Source
const KeyPowerOn = "power_on"
View Source
const KeyPowerToggle = "power_toggle"
Variables ¶
This section is empty.
Functions ¶
func NewConfigService ¶
func NewConfigService(cfg config.IConfiguration) model.IConfigService
func NewDatabaseService ¶
func NewDatabaseService(cfg config.IConfiguration) model.IDatabaseService
func NewDeviceService ¶
func NewDeviceService(cfg config.IConfiguration, restService model.IRestService, mqttService model.IMqttService, sharedMemory model.ISharedMemory) model.IDeviceService
func NewMqttService ¶
func NewMqttService() model.IMqttService
func NewNotificationService ¶
func NewNotificationService(cfg config.IConfiguration) model.INotificationService
func NewRestService ¶
func NewRestService() model.IRestService
func NewServiceFactory ¶
func NewServiceFactory(cfg config.IConfiguration) model.IServiceFactory
func NewSharedMemory ¶
func NewSharedMemory(cfg config.IConfiguration) model.ISharedMemory
func NewTelegramService ¶
func NewTelegramService(cfg config.IConfiguration) model.ITelegramService
func NewUserService ¶
func NewUserService(cfg config.IConfiguration, databaseService model.IDatabaseService) model.IUserService
Types ¶
type ConfigService ¶
type ConfigService struct {
// contains filtered or unexported fields
}
func (*ConfigService) GetRoomsConfig ¶
func (c *ConfigService) GetRoomsConfig() (model.Dictionary, error)
func (*ConfigService) GetServerStatus ¶
func (c *ConfigService) GetServerStatus() (*model.ServerStatus, error)
func (*ConfigService) SetMqttStatus ¶
func (c *ConfigService) SetMqttStatus(connectionStatus int)
func (*ConfigService) SetWebsocketStatus ¶
func (c *ConfigService) SetWebsocketStatus(connected bool)
type DatabaseService ¶
type DatabaseService struct {
// contains filtered or unexported fields
}
func (*DatabaseService) GetUserSettings ¶
func (s *DatabaseService) GetUserSettings(userName string) (*model.UserSettings, error)
func (*DatabaseService) Persist ¶
func (s *DatabaseService) Persist()
func (*DatabaseService) SaveUserSettings ¶
func (s *DatabaseService) SaveUserSettings(userName string, settings *model.UserSettings) error
type DeviceService ¶
type DeviceService struct {
// contains filtered or unexported fields
}
func (*DeviceService) DeviceCommand ¶
func (d *DeviceService) DeviceCommand(deviceKey string, params model.Dictionary) bool
func (*DeviceService) DeviceGroupCommand ¶
func (d *DeviceService) DeviceGroupCommand(groupKey string, params model.Dictionary) bool
func (*DeviceService) DeviceState ¶
func (d *DeviceService) DeviceState(deviceKey string) interface{}
func (*DeviceService) DeviceStates ¶
func (d *DeviceService) DeviceStates() model.Dictionary
func (*DeviceService) DeviceUpdate ¶
func (d *DeviceService) DeviceUpdate(dev *model.Device, oldState string)
func (*DeviceService) GetDevice ¶
func (d *DeviceService) GetDevice(deviceKey string) (*model.Device, error)
func (*DeviceService) GetDevices ¶
func (d *DeviceService) GetDevices() (*model.Devices, error)
func (*DeviceService) GetDevicesDto ¶
func (d *DeviceService) GetDevicesDto(filter model.DeviceFilter) (*model.DevicesDto, error)
func (*DeviceService) ReloadDevices ¶
func (d *DeviceService) ReloadDevices() error
type MqttService ¶
type MqttService struct {
// contains filtered or unexported fields
}
func (*MqttService) HandleMessage ¶
func (m *MqttService) HandleMessage(topic string, payload []byte)
func (*MqttService) Publish ¶
func (m *MqttService) Publish(topic string, payload interface{}) bool
func (*MqttService) SetClient ¶
func (m *MqttService) SetClient(client mqtt.Client)
func (*MqttService) SetMessageHandler ¶
func (m *MqttService) SetMessageHandler(handler model.MqttMessageHandler)
func (*MqttService) Subscribe ¶
func (m *MqttService) Subscribe(topic string) bool
type NotificationService ¶
type NotificationService struct {
// contains filtered or unexported fields
}
func (*NotificationService) GetNotifications ¶
func (n *NotificationService) GetNotifications(deviceKey string, key string) ([]*model.Notification, error)
func (*NotificationService) ReloadNotifications ¶
func (n *NotificationService) ReloadNotifications() error
type RestService ¶
type RestService struct {
// contains filtered or unexported fields
}
func (*RestService) GetRequest ¶
func (r *RestService) GetRequest(url string, device *model.Device) bool
func (*RestService) HandleMessage ¶
func (r *RestService) HandleMessage(device *model.Device, payload string)
func (*RestService) SetMessageHandler ¶
func (r *RestService) SetMessageHandler(handler model.RestMessageHandler)
type ServiceFactory ¶
type ServiceFactory struct {
// contains filtered or unexported fields
}
func (*ServiceFactory) Finalize ¶
func (s *ServiceFactory) Finalize()
func (*ServiceFactory) GetConfigService ¶
func (s *ServiceFactory) GetConfigService() model.IConfigService
func (*ServiceFactory) GetDatabaseService ¶
func (s *ServiceFactory) GetDatabaseService() model.IDatabaseService
func (*ServiceFactory) GetDeviceService ¶
func (s *ServiceFactory) GetDeviceService() model.IDeviceService
func (*ServiceFactory) GetMqttService ¶
func (s *ServiceFactory) GetMqttService() model.IMqttService
func (*ServiceFactory) GetNotificationService ¶
func (s *ServiceFactory) GetNotificationService() model.INotificationService
func (*ServiceFactory) GetRestService ¶
func (s *ServiceFactory) GetRestService() model.IRestService
func (*ServiceFactory) GetSharedMemory ¶
func (s *ServiceFactory) GetSharedMemory() model.ISharedMemory
func (*ServiceFactory) GetTelegramService ¶
func (s *ServiceFactory) GetTelegramService() model.ITelegramService
func (*ServiceFactory) GetUserService ¶
func (s *ServiceFactory) GetUserService() model.IUserService
type SharedMemory ¶
type SharedMemory struct {
// contains filtered or unexported fields
}
func (*SharedMemory) GetDeviceMem ¶
func (s *SharedMemory) GetDeviceMem(deviceKey string) interface{}
func (*SharedMemory) GetLastUpdated ¶
func (s *SharedMemory) GetLastUpdated(deviceKey string) int64
func (*SharedMemory) GetMem ¶
func (s *SharedMemory) GetMem(deviceKey string, key string) interface{}
func (*SharedMemory) GetMemory ¶
func (s *SharedMemory) GetMemory() model.Dictionary
func (*SharedMemory) LoadSharedMem ¶
func (s *SharedMemory) LoadSharedMem()
func (*SharedMemory) MarkAsUpdated ¶
func (s *SharedMemory) MarkAsUpdated(deviceKey string)
func (*SharedMemory) Persist ¶
func (s *SharedMemory) Persist()
func (*SharedMemory) SetMem ¶
func (s *SharedMemory) SetMem(deviceKey string, key string, value interface{})
func (*SharedMemory) SetNotifyCallback ¶
func (s *SharedMemory) SetNotifyCallback(notifyFunc model.NotifyFunc)
type TelegramService ¶
type TelegramService struct {
// contains filtered or unexported fields
}
func (*TelegramService) SendMessage ¶
func (t *TelegramService) SendMessage(message string) bool
type UserService ¶
type UserService struct {
// contains filtered or unexported fields
}
func (*UserService) FindByUsername ¶
func (u *UserService) FindByUsername(userName string) (*model.User, error)
func (*UserService) GetSettings ¶
func (u *UserService) GetSettings(userName string) (*model.UserSettings, error)
func (*UserService) ReloadUsers ¶
func (u *UserService) ReloadUsers() error
func (*UserService) SaveSettings ¶
func (u *UserService) SaveSettings(userName string, settings *model.UserSettings) error
Click to show internal directories.
Click to hide internal directories.