overflow_discovery/server/server.go
crusader bb465d3628 ing
2017-11-15 15:59:43 +09:00

24 lines
476 B
Go

package server
import (
cr "git.loafle.net/commons_go/rpc"
crpj "git.loafle.net/commons_go/rpc/protocol/json"
"git.loafle.net/commons_go/server"
"git.loafle.net/overflow/overflow_discovery/rpc"
)
func New(addr string) server.Server {
rpcRegistry := cr.NewRegistry()
rpc.RegisterRPC(rpcRegistry)
rpcSH := newRPCServerHandler(rpcRegistry)
rpcSH.RegisterCodec(crpj.NewServerCodec(), crpj.Name)
sh := newServerHandler(addr, rpcSH)
s := server.New(sh)
return s
}