Adding a communication channel between server and clients using SSE
This commit is contained in:
@@ -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" }
|
||||
Reference in New Issue
Block a user