Add tests for noop event stream

This commit is contained in:
9seconds
2021-03-16 11:38:29 +03:00
parent f0063ba089
commit e009d05a90
8 changed files with 160 additions and 13 deletions
+15 -9
View File
@@ -5,21 +5,27 @@ import (
"time"
)
type eventBase struct {
type EventStart struct {
CreatedAt time.Time
ConnID string
RemoteIP net.IP
}
func (e EventStart) StreamID() string {
return e.ConnID
}
type EventFinish struct {
CreatedAt time.Time
ConnID string
}
func (e eventBase) ConnectionID() string {
func (e EventFinish) StreamID() string {
return e.ConnID
}
type EventStart struct {
eventBase
type EventConcurrencyLimited struct{}
RemoteIP net.IP
}
type EventFinish struct {
eventBase
func (e EventConcurrencyLimited) StreamID() string {
return ""
}
+1 -1
View File
@@ -28,7 +28,7 @@ type IPBlocklist interface {
}
type Event interface {
ConnectionID() string
StreamID() string
}
type EventStream interface {