Adding a communication channel between server and clients using SSE

This commit is contained in:
Deluan
2020-11-08 00:06:48 -05:00
parent 3fc81638c7
commit 2b1a5f579a
15 changed files with 395 additions and 25 deletions
+18
View File
@@ -0,0 +1,18 @@
package events
type Event interface {
EventName() string
}
type ScanStatus struct {
Scanning bool `json:"scanning"`
Count int64 `json:"count"`
}
func (s ScanStatus) EventName() string { return "scanStatus" }
type KeepAlive struct {
TS int64 `json:"ts"`
}
func (s KeepAlive) EventName() string { return "keepAlive" }