func (h *Hub) deleteSubscriber(id string) { if subscriber, found := h.subscribers[id]; found == true { subscriber.commandListener <- SubscriberControlCommand{command: SubscriberStop} delete(h.subscribers, id) l.Df("subscriber deleted %s", id) } }
func (h *Hub) onServeFileRequest(m DataMediator, file string) { b, err := ioutil.ReadFile("web/" + file) if err != nil { l.Wf("file not found %s", "web/"+file) } if err == nil { l.Df("found file %s", file) m.WriteResponse(string(b), "plain") } }