Skip to content

neptulon/jsonrpc

Repository files navigation

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

(Experimental) Testing for separating JSON-RPC module into its own repo from main Neptulon package.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages