jsonrpc-server demonstrates how to serve Golang RPC methods over HTTP using the JSON-RPC encoding.
go install github.com/kelseyhightower/jsonrpc-server
Start the jsonrpc server:
jsonrpc-server
curl -d '{"method":"Arith.Divide","params":[{"A": 10, "B":2}], "id": 0}' http://localhost:8080
{"id":0,"result":{"Quo":5,"Rem":0},"error":null}