neko/internal/types/websocket.go

20 lines
386 B
Go
Raw Normal View History

package types
import "net/http"
2020-12-12 18:37:19 +01:00
type HandlerFunction func(Session, []byte) bool
2021-01-23 18:18:14 +01:00
type CheckOrigin func(r *http.Request) bool
2020-11-25 18:36:33 +01:00
type WebSocketPeer interface {
Send(v interface{}) error
Destroy() error
}
2020-11-01 16:09:48 +01:00
type WebSocketManager interface {
2020-10-28 20:29:18 +01:00
Start()
Shutdown() error
2020-12-12 18:37:19 +01:00
AddHandler(handler HandlerFunction)
2021-01-23 18:18:14 +01:00
Upgrade(w http.ResponseWriter, r *http.Request, checkOrigin CheckOrigin) error
}