This commit is contained in:
crusader
2018-03-16 16:46:31 +09:00
parent f5e37136e0
commit c78d3b60ea
6 changed files with 60 additions and 9 deletions

View File

@@ -1,15 +1,24 @@
package server
import (
cdr "git.loafle.net/commons_go/di/registry"
crr "git.loafle.net/commons_go/rpc/registry"
"git.loafle.net/commons_go/server"
"git.loafle.net/overflow/overflow_discovery/service"
oodca "git.loafle.net/overflow/overflow_discovery/commons/annotation"
oods "git.loafle.net/overflow/overflow_discovery/service"
oopcs "git.loafle.net/overflow/overflow_probe_container/server"
)
func New(pidPath string) server.Server {
oods.InitService()
rpcRegistry := crr.NewRPCRegistry()
service.RegisterRPC(rpcRegistry)
services := cdr.GetInstancesByAnnotationName(oodca.ServiceTag)
for _, s := range services {
rpcRegistry.RegisterService(s, "")
}
rpcSH := oopcs.NewRPCServletHandler(rpcRegistry)
socketHandler := newSocketHandler(rpcSH)