2017-11-14 07:52:12 +00:00
|
|
|
package subscribe
|
|
|
|
|
|
|
|
import (
|
|
|
|
"git.loafle.net/commons_go/logging"
|
2017-11-14 08:10:59 +00:00
|
|
|
cwf "git.loafle.net/commons_go/websocket_fasthttp"
|
2017-11-14 07:52:12 +00:00
|
|
|
"git.loafle.net/overflow/overflow_gateway_websocket/servlet"
|
|
|
|
oos "git.loafle.net/overflow/overflow_subscriber"
|
|
|
|
)
|
|
|
|
|
|
|
|
type SubscriberHandlers struct {
|
|
|
|
oos.SubscriberHandlers
|
|
|
|
|
|
|
|
ServletHandler servlet.ServletHandler
|
|
|
|
}
|
|
|
|
|
2017-11-14 07:57:16 +00:00
|
|
|
func (sh *SubscriberHandlers) GetSocket(id string) cwf.Socket {
|
|
|
|
return sh.ServletHandler.GetSocket(id)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (sh *SubscriberHandlers) GetSockets() map[string]cwf.Socket {
|
|
|
|
return sh.ServletHandler.GetSockets()
|
|
|
|
}
|
|
|
|
|
2017-11-14 07:52:12 +00:00
|
|
|
func (sh *SubscriberHandlers) Validate() {
|
|
|
|
sh.SubscriberHandlers.Validate()
|
|
|
|
|
|
|
|
if nil == sh.ServletHandler {
|
2018-03-21 11:17:31 +00:00
|
|
|
logging.Logger().Panicf("Gateway Websocket: servletHandler must be specified")
|
2017-11-14 07:52:12 +00:00
|
|
|
}
|
|
|
|
}
|