overflow_gateway_webapp/servlet/web/web.go

32 lines
652 B
Go
Raw Normal View History

2017-11-14 10:10:28 +00:00
package web
import (
"fmt"
"git.loafle.net/commons_go/logging"
oogwc "git.loafle.net/overflow/overflow_gateway_websocket/config"
oogws "git.loafle.net/overflow/overflow_gateway_websocket/server"
2017-11-23 08:09:29 +00:00
oosc "git.loafle.net/overflow/overflow_server_config"
2017-11-14 10:10:28 +00:00
)
const (
Name = "web"
)
var (
2017-11-23 08:09:29 +00:00
cfg *oosc.Servlet
2017-11-14 10:10:28 +00:00
)
func Initialize(sh oogws.ServerHandler) {
cfg = oogwc.Config.Servlets[Name]
if nil == cfg {
logging.Logger().Panic(fmt.Sprintf("Webapp: config of servlet[%s] is not exist", Name))
}
rpcGH := newRPCGatewayHandler()
rpcSH := sh.RegisterRPCGatewayServlet(Name, rpcGH)
sub := newSubscriberHandler(rpcSH)
sh.RegisterSubscriber(sub)
}