From 5c155bf10179a737455b0ce44696850f9d15dd3e Mon Sep 17 00:00:00 2001 From: Trey Jones Date: Wed, 20 Dec 2017 18:33:51 -0500 Subject: [PATCH] Exported NewClientCodec. --- jsonrpc2/client.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jsonrpc2/client.go b/jsonrpc2/client.go index 8f2a615..5846e6d 100644 --- a/jsonrpc2/client.go +++ b/jsonrpc2/client.go @@ -34,8 +34,8 @@ type clientCodec struct { pending map[uint64]string // map request id to method name } -// newClientCodec returns a new rpc.ClientCodec using JSON-RPC 2.0 on conn. -func newClientCodec(conn io.ReadWriteCloser) rpc.ClientCodec { +// NewClientCodec returns a new rpc.ClientCodec using JSON-RPC 2.0 on conn. +func NewClientCodec(conn io.ReadWriteCloser) rpc.ClientCodec { return &clientCodec{ dec: json.NewDecoder(conn), enc: json.NewEncoder(conn), @@ -239,7 +239,7 @@ func (c Client) Notify(serviceMethod string, args interface{}) error { // NewClient returns a new Client to handle requests to the // set of services at the other end of the connection. func NewClient(conn io.ReadWriteCloser) *Client { - codec := newClientCodec(conn) + codec := NewClientCodec(conn) client := rpc.NewClientWithCodec(codec) return &Client{client, codec.(*clientCodec)} }