Documentation ¶
Overview ¶
Package server contains go-home server.
Index ¶
- func NewServer(settings providers.ISettingsProvider) (providers.IServerProvider, error)
- type ErrBadRequest
- type ErrUnknownCommand
- type ErrUnknownDevice
- type ErrUnknownGroup
- type ErrUnsupportedCommand
- type GoHomeServer
- func (s *GoHomeServer) GetDevice(id string) *providers.KnownDevice
- func (s *GoHomeServer) InternalCommandInvokeDeviceCommand(deviceRegexp glob.Glob, cmd enums.Command, data map[string]interface{})
- func (s *GoHomeServer) PushMasterDeviceUpdate(update *providers.MasterDeviceUpdate)
- func (s *GoHomeServer) SendNotificationCommand(notificationRegexp glob.Glob, msg string)
- func (s *GoHomeServer) Start()
- type IServerStateProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewServer ¶
func NewServer(settings providers.ISettingsProvider) (providers.IServerProvider, error)
NewServer constructs a new master server. nolint: dupl
Types ¶
type ErrUnknownCommand ¶
type ErrUnknownCommand struct {
Name string
}
ErrUnknownCommand defines unknown command error.
type ErrUnknownDevice ¶
type ErrUnknownDevice struct {
ID string
}
ErrUnknownDevice defines unknown device error.
type ErrUnknownGroup ¶
type ErrUnknownGroup struct {
Name string
}
ErrUnknownGroup defines unknown group error.
type ErrUnsupportedCommand ¶
type ErrUnsupportedCommand struct {
Name string
}
ErrUnsupportedCommand defines unsupported on device command error.
func (*ErrUnsupportedCommand) Error ¶
func (e *ErrUnsupportedCommand) Error() string
Error formats output.
type GoHomeServer ¶
type GoHomeServer struct { Settings providers.ISettingsProvider Logger common.ILoggerProvider MessageParser bus.IMasterMessageParserProvider // contains filtered or unexported fields }
GoHomeServer describes master node.
func (*GoHomeServer) GetDevice ¶
func (s *GoHomeServer) GetDevice(id string) *providers.KnownDevice
GetDevice returns known device.
func (*GoHomeServer) InternalCommandInvokeDeviceCommand ¶
func (s *GoHomeServer) InternalCommandInvokeDeviceCommand( deviceRegexp glob.Glob, cmd enums.Command, data map[string]interface{})
InternalCommandInvokeDeviceCommand invokes devices operations. This command is used strictly internally.
func (*GoHomeServer) PushMasterDeviceUpdate ¶
func (s *GoHomeServer) PushMasterDeviceUpdate(update *providers.MasterDeviceUpdate)
PushMasterDeviceUpdate pushed device to known devices state
func (*GoHomeServer) SendNotificationCommand ¶
func (s *GoHomeServer) SendNotificationCommand(notificationRegexp glob.Glob, msg string)
SendNotificationCommand invokes notification system and sending a message.
type IServerStateProvider ¶
type IServerStateProvider interface { Discovery(msg *bus.DiscoveryMessage) Update(msg *bus.DeviceUpdateMessage) EntityLoad(msg *bus.EntityLoadStatusMessage) GetAllDevices() []*knownDevice GetDevice(string) *knownDevice GetWorkers() []*knownWorker GetEntities() []*knownEntity }
IServerStateProvider defines server state logic.