This commit is contained in:
crusader
2018-03-21 19:34:40 +09:00
parent c78d3b60ea
commit 3ceb82880a
8 changed files with 57 additions and 48 deletions

View File

@@ -2,6 +2,7 @@ package server
import (
cdr "git.loafle.net/commons_go/di/registry"
"git.loafle.net/commons_go/logging"
crr "git.loafle.net/commons_go/rpc/registry"
"git.loafle.net/commons_go/server"
oodca "git.loafle.net/overflow/overflow_discovery/commons/annotation"
@@ -10,11 +11,17 @@ import (
)
func New(pidPath string) server.Server {
var (
services []interface{}
err error
)
oods.InitService()
rpcRegistry := crr.NewRPCRegistry()
services := cdr.GetInstancesByAnnotationName(oodca.ServiceTag)
if services, err = cdr.GetInstancesByAnnotationName(oodca.ServiceTag); nil != err {
logging.Logger().Panic(err)
}
for _, s := range services {
rpcRegistry.RegisterService(s, "")