vwego

package module
v0.0.0-...-c4bb943 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2016 License: Apache-2.0 Imports: 14 Imported by: 0

README

vwego

Go Report Card

Based on fauxmo

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateConfig

func CreateConfig(devices []string, path string) error

Types

type Device

type Device struct {
	UUID string
	UU   string
	Name string
	Port int
	// contains filtered or unexported fields
}

func (*Device) Debug

func (d *Device) Debug(data *LogData)

func (*Device) DiscoveryRequest

func (d *Device) DiscoveryRequest(m *protocol.DiscoveryRequest)

func (*Device) Error

func (d *Device) Error(data *LogData)

func (*Device) HandleBasicEvent

func (d *Device) HandleBasicEvent(rw http.ResponseWriter, req *http.Request)

func (*Device) PublishEvent

func (d *Device) PublishEvent(command string)

func (*Device) SendDiscoveryResponse

func (d *Device) SendDiscoveryResponse(remoteAddress *net.UDPAddr)

func (*Device) ServeHTTP

func (d *Device) ServeHTTP(rw http.ResponseWriter, req *http.Request)

func (*Device) ServeSettingsXml

func (d *Device) ServeSettingsXml(rw http.ResponseWriter, req *http.Request)

func (*Device) StartServer

func (d *Device) StartServer(vServer *VwegoServer)

type DeviceEvent

type DeviceEvent struct {
	UUID    string
	Name    string
	Command string
}

type LogData

type LogData map[string]interface{}

type VwegoConfig

type VwegoConfig struct {
	NatsPort    int
	LogzIOToken string
	Devices     []*Device
}

DeviceConfig is the format of the configuration file

func (*VwegoConfig) SaveConfig

func (srv *VwegoConfig) SaveConfig(path string) error

type VwegoServer

type VwegoServer struct {
	ServerIP   string
	ConfigPath string
	NatsServer *server.Server
	EncConn    *nats.EncodedConn
	Config     *VwegoConfig
}

VwegoServer is the virtual we go server struct

func (*VwegoServer) EncodedConnection

func (s *VwegoServer) EncodedConnection() (ec *nats.EncodedConn, err error)

func (*VwegoServer) ReadConfig

func (s *VwegoServer) ReadConfig() error

func (*VwegoServer) Run

func (s *VwegoServer) Run()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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