server

package
v0.0.0-...-8f3712b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 1, 2019 License: MIT Imports: 35 Imported by: 0

Documentation

Overview

Package server contains go-home server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewServer

NewServer constructs a new master server. nolint: dupl

Types

type ErrBadRequest

type ErrBadRequest struct {
}

ErrBadRequest defines generic server error.

func (*ErrBadRequest) Error

func (e *ErrBadRequest) Error() string

Error formats output.

type ErrUnknownCommand

type ErrUnknownCommand struct {
	Name string
}

ErrUnknownCommand defines unknown command error.

func (*ErrUnknownCommand) Error

func (e *ErrUnknownCommand) Error() string

Error formats output.

type ErrUnknownDevice

type ErrUnknownDevice struct {
	ID string
}

ErrUnknownDevice defines unknown device error.

func (*ErrUnknownDevice) Error

func (e *ErrUnknownDevice) Error() string

Error formats output.

type ErrUnknownGroup

type ErrUnknownGroup struct {
	Name string
}

ErrUnknownGroup defines unknown group error.

func (*ErrUnknownGroup) Error

func (e *ErrUnknownGroup) Error() string

Error formats output.

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.

func (*GoHomeServer) Start

func (s *GoHomeServer) Start()

Start launches master server.

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.

Directories

Path Synopsis
Package statik contains auto-generated static files for the dashboard.
Package statik contains auto-generated static files for the dashboard.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL