2017-10-31 10:27:26 +00:00
|
|
|
package client
|
|
|
|
|
|
|
|
import (
|
|
|
|
"git.loafle.net/commons_go/rpc"
|
2017-11-01 03:20:52 +00:00
|
|
|
"git.loafle.net/commons_go/rpc/client"
|
2017-11-01 06:47:59 +00:00
|
|
|
"git.loafle.net/commons_go/rpc/protocol/json"
|
2017-10-31 10:27:26 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func NewClientHandler(addr string, registry rpc.Registry) *ClientHandlers {
|
|
|
|
ch := &ClientHandlers{}
|
2017-11-01 03:20:52 +00:00
|
|
|
ch.addr = addr
|
|
|
|
ch.RPCRegistry = registry
|
2017-11-01 06:47:59 +00:00
|
|
|
ch.Codec = json.NewClientCodec()
|
2017-10-31 10:27:26 +00:00
|
|
|
|
|
|
|
return ch
|
|
|
|
}
|
|
|
|
|
|
|
|
type ClientHandlers struct {
|
2017-11-01 03:20:52 +00:00
|
|
|
client.ClientHandlers
|
2017-10-31 10:27:26 +00:00
|
|
|
|
2017-11-01 03:20:52 +00:00
|
|
|
addr string
|
2017-10-31 10:27:26 +00:00
|
|
|
}
|