package iot import "log" import "fmt" import "udi/handlers/handler" var idSeq int = 0 type IoTHandler struct { id int } func NewIoTHandler() handler.Handler { t := &IoTHandler { id: idSeq, } idSeq += 1 return t } func (self *IoTHandler) GetId() string { return fmt.Sprintf("IoT%d", self.id) } func (self *IoTHandler) Handle(message handler.MessageT) { log.Printf("Handler IoT %d processing %s -> %s", self.id, message.Topic, message.Payload) }