22 lines
363 B
Go
22 lines
363 B
Go
|
package rpc
|
||
|
|
||
|
import (
|
||
|
"git.loafle.net/commons_go/rpc"
|
||
|
"git.loafle.net/commons_go/rpc/protocol/json"
|
||
|
rpcServer "git.loafle.net/commons_go/rpc/server"
|
||
|
)
|
||
|
|
||
|
func New(registry rpc.Registry) Server {
|
||
|
|
||
|
sh := NewServerHandler(registry)
|
||
|
sh.RegisterCodec(json.NewServerCodec(), "json")
|
||
|
|
||
|
s := rpcServer.New(sh)
|
||
|
|
||
|
return s
|
||
|
}
|
||
|
|
||
|
type Server interface {
|
||
|
rpcServer.Server
|
||
|
}
|