websocket_fasthttp/server_handler.go

33 lines
664 B
Go
Raw Normal View History

2017-11-07 10:03:40 +00:00
package websocket_fasthttp
import (
"net"
"time"
"github.com/valyala/fasthttp"
)
type ServerHandler interface {
Listen() (net.Listener, error)
CheckOrigin(ctx *fasthttp.RequestCtx) bool
OnError(ctx *fasthttp.RequestCtx, status int, reason error)
OnStart()
OnStop()
RegisterSocketHandler(path string, handler SocketHandler)
GetSocketHandler(path string) (SocketHandler, error)
GetName() string
GetConcurrency() int
GetMaxStopWaitTime() time.Duration
GetHandshakeTimeout() time.Duration
GetReadBufferSize() int
GetWriteBufferSize() int
GetReadTimeout() time.Duration
GetWriteTimeout() time.Duration
IsEnableCompression() bool
Validate()
}