rpc-codec

module
v1.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2020 License: MIT

README

JSON-RPC 2.0 GoDoc CircleCI Coverage Status Go Report Card

jsonrpc2 is a codec for net/rpc.

Implements JSON-RPC 2.0 and JSON-RPC 2.0 Transport: HTTP specifications with following limitations:

  • Client: Batch Request not supported.
  • HTTP Client&Server: Pipelined Requests/Responses not supported.
  • HTTP Client&Server: GET Request not supported.

Also provides command-line tool jsonrpc2client.

Installation

go get github.com/powerman/rpc-codec/...

Or, if you need only jsonrpc2client tool, then download binary for your OS manually from releases or run this to install the latest version:

curl -sfL $(curl -s https://api.github.com/repos/powerman/rpc-codec/releases/latest | grep -i /jsonrpc2client-$(uname -s)-$(uname -m)\" | cut -d\" -f4) | sudo install /dev/stdin /usr/local/bin/jsonrpc2client

Usage

jsonrpc2client
$ jsonrpc2client -h
Usage: jsonrpc2client [flags] method params-as-json
  -http.endpoint string
        service endpoint as url
  -notification
        send notification request
  -tcp.addr string
        service endpoint as host:port
  -transport string
        transport (stdin|tcp|http) (default "http")
  -version
        print version
$ jsonrpc2client -http.endpoint https://example.com/rpc method.name '{"namedArg1":"value"}'
$ jsonrpc2client -http.endpoint https://example.com/rpc method.name '["positionalArg1"]'

Directories

Path Synopsis
cmd
Package jsonrpc2 implements a JSON-RPC 2.0 ClientCodec and ServerCodec for the net/rpc package and HTTP transport for JSON-RPC 2.0.
Package jsonrpc2 implements a JSON-RPC 2.0 ClientCodec and ServerCodec for the net/rpc package and HTTP transport for JSON-RPC 2.0.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL