overflow_discovery/server/server.go

22 lines
465 B
Go
Raw Normal View History

2017-10-26 12:55:55 +00:00
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
}