overflow_discovery/server/server.go
crusader 44bc4f51d8 ing
2017-10-26 21:55:55 +09:00

22 lines
465 B
Go

package server
import (
"git.loafle.net/commons_go/rpc"
"git.loafle.net/commons_go/rpc/protocol/json"
"git.loafle.net/commons_go/server"
dRPC "git.loafle.net/overflow/overflow_discovery/server/rpc"
)
func New(addr string) server.Server {
registry := rpc.NewRegistry()
registry.RegisterCodec(json.NewCodec(), "json")
registry.RegisterService(new(dRPC.DiscoveryService), "")
sh := NewServerHandler(addr, registry)
s := server.NewServer(sh)
return s
}