24 lines
476 B
Go
Raw Normal View History

2017-10-26 21:55:55 +09:00
package server
import (
2017-11-15 15:59:43 +09:00
cr "git.loafle.net/commons_go/rpc"
crpj "git.loafle.net/commons_go/rpc/protocol/json"
2017-10-26 21:55:55 +09:00
"git.loafle.net/commons_go/server"
2017-11-15 15:59:43 +09:00
"git.loafle.net/overflow/overflow_discovery/rpc"
2017-10-26 21:55:55 +09:00
)
2017-11-15 15:59:43 +09:00
func New(addr string) server.Server {
rpcRegistry := cr.NewRegistry()
rpc.RegisterRPC(rpcRegistry)
rpcSH := newRPCServerHandler(rpcRegistry)
rpcSH.RegisterCodec(crpj.NewServerCodec(), crpj.Name)
2017-10-26 21:55:55 +09:00
2017-11-15 15:59:43 +09:00
sh := newServerHandler(addr, rpcSH)
2017-10-26 21:55:55 +09:00
2017-11-01 15:35:03 +09:00
s := server.New(sh)
2017-10-26 21:55:55 +09:00
return s
}