websocket_fasthttp/client/socket_handler.go

28 lines
542 B
Go
Raw Normal View History

2017-11-29 21:24:48 +09:00
package client
2017-11-29 23:56:36 +09:00
import (
"net/http"
"time"
)
2017-11-29 21:24:48 +09:00
type SocketHandler interface {
2017-11-30 12:15:05 +09:00
OnConnect(socketContext SocketContext, res *http.Response)
OnDisconnect(soc Socket)
2017-11-29 23:56:36 +09:00
2017-11-30 12:15:05 +09:00
GetMaxMessageSize() int64
GetWriteTimeout() time.Duration
GetReadTimeout() time.Duration
GetPongTimeout() time.Duration
GetPingTimeout() time.Duration
GetPingPeriod() time.Duration
2017-11-29 21:24:48 +09:00
// Validate is check handler value
// If you override ths method, must call
//
// func (sh *SocketHandlers) Validate() {
// sh.SocketHandlers.Validate()
// ...
// }
Validate()
}