Documentation
¶
Index ¶
- type Device
- type DeviceDto
- type DeviceFilter
- type DeviceMqtt
- type DeviceMqttTemplate
- type DeviceRest
- type DeviceRestTemplate
- type DeviceTopic
- type Devices
- type DevicesDto
- type Dictionary
- type FWebSocketBroadcast
- type IConfigService
- type IDatabaseService
- type IDeviceRepo
- type IDeviceService
- type IMqttService
- type INotificationRepo
- type INotificationService
- type IRestService
- type IServiceFactory
- type ISharedMemory
- type ITelegramBotAPI
- type ITelegramService
- type IUserRepo
- type IUserService
- type MqttMessageHandler
- type Notification
- type NotificationTrigger
- type Notifications
- type NotifyFunc
- type RestMessageHandler
- type ServerStatus
- type Supplemental
- type User
- type UserSetting
- type UserSettings
- type Users
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Device ¶
type Device struct {
Type string `json:"type" yaml:"type"`
DeviceKey string `json:"device_key" yaml:"device_key"`
Caption string `json:"caption" yaml:"caption"`
Confirm bool `json:"confirm" yaml:"confirm"`
Mqtt DeviceMqtt `json:"mqtt" yaml:"mqtt"`
Rest DeviceRest `json:"rest" yaml:"rest"`
Optimistic bool `json:"optimistic" yaml:"optimistic"`
Timeout int64 `json:"timeout" yaml:"timeout"`
Invert Dictionary `json:"invert" yaml:"invert"`
Room string `json:"room" yaml:"room"`
Supplemental []Supplemental `json:"supplemental" yaml:"supplemental"`
Groups []string `json:"groups" yaml:"groups"`
Authorities []string `json:"authorities" yaml:"authorities"`
Expanded bool `json:"expanded" yaml:"expanded"`
Icon string `json:"icon" yaml:"icon"`
}
type DeviceDto ¶
type DeviceDto struct {
Type string `json:"type"`
DeviceKey string `json:"deviceKey"`
Caption string `json:"caption"`
Confirm bool `json:"confirm"`
Optimistic bool `json:"optimistic"`
Url string `json:"url"`
Timeout int64 `json:"timeout"`
Invert Dictionary `json:"invert"`
Room string `json:"room"`
Groups []string `json:"groups"`
Supplemental []Supplemental `json:"supplemental"`
Expanded bool `json:"expanded"`
Icon string `json:"icon"`
}
type DeviceFilter ¶
type DeviceMqtt ¶
type DeviceMqtt struct {
Template DeviceMqttTemplate `json:"template" yaml:"template"`
ListenTopics []DeviceTopic `json:"listen_topics" yaml:"listen_topics"`
CommandTopics Dictionary `json:"command_topics" yaml:"command_topics"`
}
type DeviceMqttTemplate ¶
type DeviceRest ¶
type DeviceRest struct {
Url string `json:"url" yaml:"url"`
Template DeviceRestTemplate `json:"template" yaml:"template"`
CommandPaths Dictionary `json:"command_paths" yaml:"command_paths"`
HandlerTemplate string `json:"handler_template" yaml:"handler_template"`
}
type DeviceRestTemplate ¶
type DeviceTopic ¶
type DeviceTopic struct {
Topic string `json:"topic" yaml:"topic"`
HandlerTemplate string `json:"handler_template" yaml:"handler_template"`
// contains filtered or unexported fields
}
func (*DeviceTopic) Matches ¶
func (t *DeviceTopic) Matches(topic string) bool
func (*DeviceTopic) Prepare ¶
func (t *DeviceTopic) Prepare()
type DevicesDto ¶
type DevicesDto struct {
Devices []DeviceDto `json:"devices"`
}
type Dictionary ¶
type Dictionary = map[string]interface{}
type FWebSocketBroadcast ¶
type FWebSocketBroadcast = func(dev *Device, devState interface{})
type IConfigService ¶
type IConfigService interface {
GetServerStatus() (*ServerStatus, error)
GetRoomsConfig() (Dictionary, error)
SetWebsocketStatus(connected bool)
SetMqttStatus(connectionStatus int)
}
type IDatabaseService ¶
type IDatabaseService interface {
Persist()
GetUserSettings(userName string) (*UserSettings, error)
SaveUserSettings(name string, settings *UserSettings) error
}
type IDeviceRepo ¶
type IDeviceService ¶
type IDeviceService interface {
DeviceCommand(deviceKey string, params Dictionary) bool
DeviceGroupCommand(groupKey string, params Dictionary) bool
DeviceStates() Dictionary
DeviceState(deviceKey string) interface{}
GetDevice(deviceKey string) (*Device, error)
GetDevices() (*Devices, error)
GetDevicesDto(filter DeviceFilter) (*DevicesDto, error)
DeviceUpdate(dev *Device, oldState string)
ReloadDevices() error
}
type IMqttService ¶
type INotificationRepo ¶
type INotificationRepo interface {
ReloadNotifications() error
GetNotifications(deviceKey string, key string) ([]*Notification, error)
GetAllNotifications() (*Notifications, error)
}
type INotificationService ¶
type INotificationService interface {
GetNotifications(deviceKey string, key string) ([]*Notification, error)
ReloadNotifications() error
}
type IRestService ¶
type IServiceFactory ¶
type IServiceFactory interface {
GetDeviceService() IDeviceService
GetConfigService() IConfigService
GetMqttService() IMqttService
GetTelegramService() ITelegramService
GetUserService() IUserService
GetNotificationService() INotificationService
GetRestService() IRestService
GetDatabaseService() IDatabaseService
Finalize()
}
type ISharedMemory ¶
type ISharedMemory interface {
}
type ITelegramBotAPI ¶
type ITelegramService ¶
type IUserService ¶
type IUserService interface {
FindByUsername(userName string) (*User, error)
ReloadUsers() error
SaveSettings(userName string, settings *UserSettings) error
GetSettings(userName string) (*UserSettings, error)
}
type MqttMessageHandler ¶
type Notification ¶
type Notification struct {
DeviceKey string `json:"device_key" yaml:"device_key"`
Trigger NotificationTrigger `json:"trigger" yaml:"trigger"`
Keys []string `json:"keys" yaml:"keys"`
Caption string `json:"caption" yaml:"caption"`
Script string `json:"script" yaml:"script"`
}
type NotificationTrigger ¶
type NotificationTrigger = string
const ( TriggerChange NotificationTrigger = "change" TriggerEvent NotificationTrigger = "event" )
type Notifications ¶
type Notifications struct {
Notifications []Notification `json:"notifications" yaml:"notifications"`
}
type NotifyFunc ¶
type RestMessageHandler ¶
type ServerStatus ¶
type Supplemental ¶
type UserSetting ¶
type UserSettings ¶
type UserSettings struct {
Settings []UserSetting `json:"settings"`
}
func NewUserSettings ¶
func NewUserSettings() *UserSettings
Click to show internal directories.
Click to hide internal directories.