package data import ( "fmt" "net/http" "git.loafle.net/commons_go/logging" cwfc "git.loafle.net/commons_go/websocket_fasthttp/client" ooccn "git.loafle.net/overflow/overflow_commons_go/config/noauthprobe" oocmn "git.loafle.net/overflow/overflow_commons_go/modules/noauthprobe" oops "git.loafle.net/overflow/overflow_probes/service" ) type SocketHandlers struct { cwfc.SocketHandlers napService *oops.NoAuthProbeService } func (sh *SocketHandlers) OnConnect(socketContext cwfc.SocketContext, res *http.Response) { logging.Logger().Info(fmt.Sprintf("Auth: client has been connected res[%v]", res)) switch sh.napService.Config.State() { case ooccn.NoAuthProbeStateTypeNotRegisterd: tempProbeKey := res.Header.Get(oocmn.HTTPResponseHeaderKey_NoAuthProbe_SetTempProbeKey) sh.napService.SetTempProbeKey(tempProbeKey) case ooccn.NoAuthProbeStateTypeRegisterd: } } func (sh *SocketHandlers) OnDisconnect(soc cwfc.Socket) { logging.Logger().Info(fmt.Sprintf("Auth: client has been disconnected soc[%v]", soc)) } func newSocketHandler(napService *oops.NoAuthProbeService) cwfc.SocketHandler { return &SocketHandlers{ napService: napService, } }