soygul / jsonrpc

JSON-RPC 2.0 protocol implementation for Neptulon framework.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Neptulon JSON-RPC

Build Status GoDoc

JSON-RPC 2.0 protocol implementation for Neptulon framework.

Example

Following example creates a TLS listener with JSON-RPC 2.0 protocol and starts listening for 'ping' requests and replies with a typical 'pong'.

nep, _ := neptulon.NewServer(cert, privKey, nil, "127.0.0.1:3000", true)
rpc, _ := jsonrpc.NewServer(nep)
route, _ := jsonrpc.NewRouter(rpc)

route.Request("ping", func(ctx *jsonrpc.ReqCtx) {
	ctx.Res = "pong"
})

nep.Run()

Users

Titan mobile messaging server is written entirely using the Neptulon framework. It uses JSON-RPC 2.0 package over Neptulon to act as the server part of a mobile messaging app. You can visit its repo to see a complete use case of Neptulon framework + JSON-RPC package.

Testing

All the tests can be executed with GORACE="halt_on_error=1" go test -race -cover ./... command. Optionally you can add -v flag to observe all connection logs.

License

MIT

About

JSON-RPC 2.0 protocol implementation for Neptulon framework.

License:MIT License


Languages

Language:Go 100.0%