(w http.ResponseWriter, r *http.Request)
| 103 | } |
| 104 | |
| 105 | func (mod *RestAPI) startStreamingEvents(w http.ResponseWriter, r *http.Request) { |
| 106 | ws, err := mod.upgrader.Upgrade(w, r, nil) |
| 107 | if err != nil { |
| 108 | if _, ok := err.(websocket.HandshakeError); !ok { |
| 109 | mod.Error("error while updating api.rest connection to websocket: %s", err) |
| 110 | } |
| 111 | return |
| 112 | } |
| 113 | |
| 114 | mod.Debug("websocket streaming started for %s", r.RemoteAddr) |
| 115 | |
| 116 | go mod.streamWriter(ws, w, r) |
| 117 | mod.streamReader(ws) |
| 118 | } |
no test coverage detected