add support for modules.

This commit is contained in:
Miroslav Šedivý
2020-12-12 18:37:19 +01:00
parent 5b69413e01
commit b197bb303e
5 changed files with 23 additions and 7 deletions

View File

@ -6,4 +6,5 @@ import (
type ApiManager interface {
Route(r chi.Router)
AddRouter(path string, router func(chi.Router))
}

View File

@ -2,6 +2,8 @@ package types
import "net/http"
type HandlerFunction func(Session, []byte) bool
type WebSocketPeer interface {
Send(v interface{}) error
Destroy() error
@ -10,5 +12,6 @@ type WebSocketPeer interface {
type WebSocketManager interface {
Start()
Shutdown() error
AddHandler(handler HandlerFunction)
Upgrade(w http.ResponseWriter, r *http.Request) error
}