Exemplo n.º 1
0
Arquivo: main.go Projeto: conas/tno2
//Basic low level wotServer setup
func main() {
	//WoT server defines implements interaction with device
	wotServer := server.CreateFromDescriptionUri(model)
	setupWotServer(wotServer)

	//Frontend is transport implementation
	feCfg := col.AsMap([]*col.KeyValue{col.KV("port", 8080)})
	fe := frontend.NewHTTP(feCfg)
	fe.Bind("/01-basic-example", wotServer)
	fe.Start()
}
Exemplo n.º 2
0
func (p *Platform) AddBackend(bedID, beType string, cfgParams ...*col.KeyValue) {
	params := col.AsMap(cfgParams)

	be := beTypes[beType](params)
	p.backends[bedID] = be
}