package client import ( "net" "git.loafle.net/commons_go/rpc" "git.loafle.net/commons_go/rpc/client" "git.loafle.net/commons_go/rpc/protocol/json" ) func NewClientHandler(addr string, registry rpc.Registry) ClientHandler { ch := &ClientHandlers{} ch.addr = addr ch.RPCRegistry = registry ch.Codec = json.NewClientCodec() return ch } type ClientHandlers struct { client.ClientHandlers addr string } func (ch *ClientHandlers) Connect() (net.Conn, error) { return net.Dial("unix", ch.addr) }