overflow_gateway_webapp/servlet/web/web.go
crusader e92a8ead89 ing
2017-11-14 19:10:28 +09:00

31 lines
598 B
Go

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"
)
const (
Name = "web"
)
var (
cfg *oogwc.Servlet
)
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)
}