ing
This commit is contained in:
parent
df755f58d7
commit
61aa8c6acd
|
@ -2,7 +2,7 @@ package server
|
||||||
|
|
||||||
import (
|
import (
|
||||||
cs "git.loafle.net/commons/server-go"
|
cs "git.loafle.net/commons/server-go"
|
||||||
oge "git.loafle.net/overflow/gateway/external"
|
oe "git.loafle.net/overflow/external-go"
|
||||||
ogrs "git.loafle.net/overflow/gateway_rpc/server"
|
ogrs "git.loafle.net/overflow/gateway_rpc/server"
|
||||||
"git.loafle.net/overflow/member_gateway_rpc/config"
|
"git.loafle.net/overflow/member_gateway_rpc/config"
|
||||||
"git.loafle.net/overflow/member_gateway_rpc/subscribe"
|
"git.loafle.net/overflow/member_gateway_rpc/subscribe"
|
||||||
|
@ -22,7 +22,7 @@ func (sh *ServerHandlers) Init(serverCtx cs.ServerCtx) error {
|
||||||
if err := sh.ServerHandlers.Init(serverCtx); nil != err {
|
if err := sh.ServerHandlers.Init(serverCtx); nil != err {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
oge.InitPackage(sh.Config.External)
|
oe.InitPackage(sh.Config.External)
|
||||||
subscribe.InitPackage()
|
subscribe.InitPackage()
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
@ -33,7 +33,7 @@ func (sh *ServerHandlers) OnStart(serverCtx cs.ServerCtx) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
oge.StartPackage(sh.Config.External)
|
oe.StartPackage(sh.Config.External)
|
||||||
subscribe.StartPackage()
|
subscribe.StartPackage()
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
@ -41,14 +41,14 @@ func (sh *ServerHandlers) OnStart(serverCtx cs.ServerCtx) error {
|
||||||
|
|
||||||
func (sh *ServerHandlers) OnStop(serverCtx cs.ServerCtx) {
|
func (sh *ServerHandlers) OnStop(serverCtx cs.ServerCtx) {
|
||||||
subscribe.StopPackage()
|
subscribe.StopPackage()
|
||||||
oge.StopPackage(sh.Config.External)
|
oe.StopPackage(sh.Config.External)
|
||||||
|
|
||||||
sh.ServerHandlers.OnStop(serverCtx)
|
sh.ServerHandlers.OnStop(serverCtx)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (sh *ServerHandlers) Destroy(serverCtx cs.ServerCtx) {
|
func (sh *ServerHandlers) Destroy(serverCtx cs.ServerCtx) {
|
||||||
subscribe.DestroyPackage()
|
subscribe.DestroyPackage()
|
||||||
oge.DestroyPackage(sh.Config.External)
|
oe.DestroyPackage(sh.Config.External)
|
||||||
|
|
||||||
sh.ServerHandlers.Destroy(serverCtx)
|
sh.ServerHandlers.Destroy(serverCtx)
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,7 @@ import (
|
||||||
"git.loafle.net/commons/logging-go"
|
"git.loafle.net/commons/logging-go"
|
||||||
"git.loafle.net/commons/server-go"
|
"git.loafle.net/commons/server-go"
|
||||||
"git.loafle.net/commons/server-go/socket"
|
"git.loafle.net/commons/server-go/socket"
|
||||||
|
oe "git.loafle.net/overflow/external-go"
|
||||||
og "git.loafle.net/overflow/gateway"
|
og "git.loafle.net/overflow/gateway"
|
||||||
ogs "git.loafle.net/overflow/gateway/subscribe"
|
ogs "git.loafle.net/overflow/gateway/subscribe"
|
||||||
ogrs "git.loafle.net/overflow/gateway_rpc/servlet"
|
ogrs "git.loafle.net/overflow/gateway_rpc/servlet"
|
||||||
|
@ -89,7 +90,7 @@ func (s *WebappServlets) Handshake(servletCtx server.ServletCtx, ctx *fasthttp.R
|
||||||
sessionID := uuid.NewV4().String()
|
sessionID := uuid.NewV4().String()
|
||||||
|
|
||||||
servletCtx.SetAttribute(og.SessionIDKey, sessionID)
|
servletCtx.SetAttribute(og.SessionIDKey, sessionID)
|
||||||
servletCtx.SetAttribute(og.SessionClientTypeKey, og.MEMBER)
|
servletCtx.SetAttribute(og.SessionClientTypeKey, oe.MEMBER)
|
||||||
servletCtx.SetAttribute(og.SessionTargetIDKey, userEmail)
|
servletCtx.SetAttribute(og.SessionTargetIDKey, userEmail)
|
||||||
|
|
||||||
return nil, nil
|
return nil, nil
|
||||||
|
|
|
@ -2,7 +2,7 @@ package subscribe
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"git.loafle.net/commons/logging-go"
|
"git.loafle.net/commons/logging-go"
|
||||||
oger "git.loafle.net/overflow/gateway/external/redis"
|
oer "git.loafle.net/overflow/external-go/redis"
|
||||||
ogsr "git.loafle.net/overflow/gateway/subscribe/redis"
|
ogsr "git.loafle.net/overflow/gateway/subscribe/redis"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ var Subscriber *ogsr.Subscribers
|
||||||
|
|
||||||
func InitPackage() {
|
func InitPackage() {
|
||||||
Subscriber = &ogsr.Subscribers{}
|
Subscriber = &ogsr.Subscribers{}
|
||||||
Subscriber.Conn = oger.Pool.Get()
|
Subscriber.Conn = oer.Pool.Get()
|
||||||
if err := Subscriber.Start(); nil != err {
|
if err := Subscriber.Start(); nil != err {
|
||||||
logging.Logger().Panic(err)
|
logging.Logger().Panic(err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user