Popularity
5.1
Stable
Activity
0.0
Declining
179
5
21
Programming language: Go
License: MIT License
Tags:
Distributed Systems
Latest version: v2.3.1
jsonrpc alternatives and similar packages
Based on the "Distributed Systems" category.
Alternatively, view jsonrpc alternatives based on common mentions on social networks and blogs.
-
Nomad
Nomad is an easy-to-use, flexible, and performant workload orchestrator that can deploy a mix of microservice, batch, containerized, and non-containerized applications. Nomad is easy to operate and scale and has native Consul and Vault integrations. -
go-zero
go-zero is a web and rpc framework written in Go. It's born to ensure the stability of the busy sites with resilient design. Builtin goctl greatly improves the development productivity. [Moved to: https://github.com/zeromicro/go-zero] -
rpcx
Best microservices framework in Go, like alibaba Dubbo, but with more features, Scale easily. Try it. Test it. If you feel it's better, use it! ๐๐๐ฏ๐ๆ๐๐ฎ๐๐๐จ, ๐๐จ๐ฅ๐๐ง๐ ๆ๐ซ๐ฉ๐๐ฑ! build for cloud! -
ringpop-go
Scalable, fault-tolerant application-layer sharding for Go applications -
Kitex
Go RPC framework with high-performance and strong-extensibility for building micro-services. -
KrakenD
Ultra performant API Gateway with middlewares. A project hosted at The Linux Foundation -
dragonboat
A feature complete and high performance multi-group Raft library in Go. -
emitter-io
High performance, distributed and low latency publish-subscribe platform. -
Dkron
Dkron - Distributed, fault tolerant job scheduling system https://dkron.io -
gleam
Fast, efficient, and scalable distributed map/reduce system, DAG execution, in memory or on disk, written in pure Go, runs standalone or distributedly. -
glow
Glow is an easy-to-use distributed computation system written in Go, similar to Hadoop Map Reduce, Spark, Flink, Storm, etc. I am also working on another similar pure Go system, https://github.com/chrislusf/gleam , which is more flexible and more performant. -
Olric
Distributed in-memory object store. It can be used both as an embedded Go library and as a language-independent service. -
go-doudou
go-doudou๏ผdoudou pronounce /dษudษu/๏ผis OpenAPI 3.0 (for REST) spec and Protobuf v3 (for grpc) based lightweight microservice framework. It supports monolith service application as well. -
Dragonfly
Dragonfly is an open source P2P-based file distribution and image acceleration system. It is hosted by the Cloud Native Computing Foundation (CNCF) as an Incubating Level Project. -
go-health
Library for enabling asynchronous health checks in your service -
arpc
More effective network communication, two-way calling, notify and broadcast supported. -
resgate
A Realtime API Gateway used with NATS to build REST, real time, and RPC APIs, where all your clients are synchronized seamlessly. -
go-sundheit
A library built to provide support for defining service health for golang services. It allows you to register async health checks for your dependencies and the service itself, provides a health endpoint that exposes their status, and health metrics. -
sleuth
A Go library for master-less peer-to-peer autodiscovery and RPC between HTTP services -
Maestro
Take control of your data, connect with anything, and expose it anywhere through protocols such as HTTP, GraphQL, and gRPC. -
celeriac
Golang client library for adding support for interacting and monitoring Celery workers, tasks and events. -
drmaa
Compute cluster (HPC) job submission library for Go (#golang) based on the open DRMAA standard. -
flowgraph
Flowgraph package for scalable asynchronous system development
Access the most powerful time series database as a service
Ingest, store, & analyze all types of time series data in a fully-managed, purpose-built database. Keep data forever with low-cost storage and superior data compression.
Promo
www.influxdata.com
Do you think we are missing an alternative of jsonrpc or a related project?
Popular Comparisons
README
jsonrpc
About
- Simple, Poetic, Pithy.
- No
reflect
package.- But
reflect
package is used only when invoke the debug handler.
- But
- Support GAE/Go Standard Environment.
- Compliance with JSON-RPC 2.0.
Note: If you use Go 1.6, see v1.0.
Install
$ go get -u github.com/osamingo/jsonrpc
Usage
package main
import (
"context"
"log"
"net/http"
"github.com/intel-go/fastjson"
"github.com/osamingo/jsonrpc"
)
type (
EchoHandler struct{}
EchoParams struct {
Name string `json:"name"`
}
EchoResult struct {
Message string `json:"message"`
}
PositionalHandler struct{}
PositionalParams []int
PositionalResult struct {
Message []int `json:"message"`
}
)
func (h EchoHandler) ServeJSONRPC(c context.Context, params *fastjson.RawMessage) (interface{}, *jsonrpc.Error) {
var p EchoParams
if err := jsonrpc.Unmarshal(params, &p); err != nil {
return nil, err
}
return EchoResult{
Message: "Hello, " + p.Name,
}, nil
}
func (h PositionalHandler) ServeJSONRPC(c context.Context, params *fastjson.RawMessage) (interface{}, *Error) {
var p PositionalParams
if err := jsonrpc.Unmarshal(params, &p); err != nil {
return nil, err
}
return PositionalResult{
Message: p,
}, nil
}
func main() {
mr := jsonrpc.NewMethodRepository()
if err := mr.RegisterMethod("Main.Echo", EchoHandler{}, EchoParams{}, EchoResult{}); err != nil {
log.Fatalln(err)
}
if err := mr.RegisterMethod("Main.Positional", PositionalHandler{}, PositionalParams{}, PositionalResult{}); err != nil {
log.Fatalln(err)
}
http.Handle("/jrpc", mr)
http.HandleFunc("/jrpc/debug", mr.ServeDebug)
if err := http.ListenAndServe(":8080", http.DefaultServeMux); err != nil {
log.Fatalln(err)
}
}
Advanced
package main
import (
"log"
"net/http"
"github.com/osamingo/jsonrpc"
)
type (
HandleParamsResulter interface {
jsonrpc.Handler
Name() string
Params() interface{}
Result() interface{}
}
Servicer interface {
MethodName(HandleParamsResulter) string
Handlers() []HandleParamsResulter
}
UserService struct {
SignUpHandler HandleParamsResulter
SignInHandler HandleParamsResulter
}
)
func (us *UserService) MethodName(h HandleParamsResulter) string {
return "UserService." + h.Name()
}
func (us *UserService) Handlers() []HandleParamsResulter {
return []HandleParamsResulter{us.SignUpHandler, us.SignInHandler}
}
func NewUserService() *UserService {
return &UserService{
// Initialize handlers
}
}
func main() {
mr := jsonrpc.NewMethodRepository()
for _, s := range []Servicer{NewUserService()} {
for _, h := range s.Handlers() {
mr.RegisterMethod(s.MethodName(h), h, h.Params(), h.Result())
}
}
http.Handle("/jrpc", mr)
http.HandleFunc("/jrpc/debug", mr.ServeDebug)
if err := http.ListenAndServe(":8080", http.DefaultServeMux); err != nil {
log.Fatalln(err)
}
}
Result
Invoke the Echo method
POST /jrpc HTTP/1.1
Accept: application/json, */*
Accept-Encoding: gzip, deflate
Connection: keep-alive
Content-Length: 82
Content-Type: application/json
Host: localhost:8080
User-Agent: HTTPie/0.9.6
{
"jsonrpc": "2.0",
"method": "Main.Echo",
"params": {
"name": "John Doe"
},
"id": "243a718a-2ebb-4e32-8cc8-210c39e8a14b"
}
HTTP/1.1 200 OK
Content-Length: 68
Content-Type: application/json
Date: Mon, 28 Nov 2016 13:48:13 GMT
{
"jsonrpc": "2.0",
"result": {
"message": "Hello, John Doe"
},
"id": "243a718a-2ebb-4e32-8cc8-210c39e8a14b"
}
Invoke the Positional method
POST /jrpc HTTP/1.1
Accept: */*
Content-Length: 133
Content-Type: application/json
Host: localhost:8080
User-Agent: curl/7.61.1
{
"jsonrpc": "2.0",
"method": "Main.Positional",
"params": [3,1,1,3,5,3],
"id": "243a718a-2ebb-4e32-8cc8-210c39e8a14b"
}
HTTP/1.1 200 OK
Content-Length: 97
Content-Type: application/json
Date: Mon, 05 Nov 2018 11:23:35 GMT
{
"jsonrpc": "2.0",
"result": {
"message": [3,1,1,3,5,3]
},
"id": "243a718a-2ebb-4e32-8cc8-210c39e8a14b"
}
Access to debug handler
GET /jrpc/debug HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate
Connection: keep-alive
Host: localhost:8080
User-Agent: HTTPie/0.9.6
HTTP/1.1 200 OK
Content-Length: 408
Content-Type: application/json
Date: Mon, 28 Nov 2016 13:56:24 GMT
[
{
"handler": "EchoHandler",
"name": "Main.Echo",
"params": {
"$ref": "#/definitions/EchoParams",
"$schema": "http://json-schema.org/draft-04/schema#",
"definitions": {
"EchoParams": {
"additionalProperties": false,
"properties": {
"name": {
"type": "string"
}
},
"required": [
"name"
],
"type": "object"
}
}
},
"result": {
"$ref": "#/definitions/EchoResult",
"$schema": "http://json-schema.org/draft-04/schema#",
"definitions": {
"EchoResult": {
"additionalProperties": false,
"properties": {
"message": {
"type": "string"
}
},
"required": [
"message"
],
"type": "object"
}
}
}
}
]
License
Released under the MIT License.
*Note that all licence references and agreements mentioned in the jsonrpc README section above
are relevant to that project's source code only.