mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-08-31 18:24:02 +03:00
Add tests for noop event stream
This commit is contained in:
+15
-9
@@ -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
@@ -28,7 +28,7 @@ type IPBlocklist interface {
|
||||
}
|
||||
|
||||
type Event interface {
|
||||
ConnectionID() string
|
||||
StreamID() string
|
||||
}
|
||||
|
||||
type EventStream interface {
|
||||
|
||||
Reference in New Issue
Block a user