{"id":13740546,"url":"https://github.com/nats-rpc/nrpc","last_synced_at":"2026-01-15T00:32:23.125Z","repository":{"id":22845065,"uuid":"97461034","full_name":"nats-rpc/nrpc","owner":"nats-rpc","description":"nRPC is like gRPC, but over NATS","archived":false,"fork":false,"pushed_at":"2024-09-25T08:56:48.000Z","size":316,"stargazers_count":698,"open_issues_count":14,"forks_count":65,"subscribers_count":30,"default_branch":"master","last_synced_at":"2025-12-02T03:58:48.847Z","etag":null,"topics":["go","grpc","protobuf","rpc-framework"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nats-rpc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-07-17T09:50:11.000Z","updated_at":"2025-12-01T15:49:10.000Z","dependencies_parsed_at":"2024-12-20T18:05:06.696Z","dependency_job_id":"b1f81afc-ee4b-4b0d-b561-fc24e5d64b5c","html_url":"https://github.com/nats-rpc/nrpc","commit_stats":{"total_commits":143,"total_committers":9,"mean_commits":15.88888888888889,"dds":"0.15384615384615385","last_synced_commit":"18e69326f0521eb2e544f1b10a925c744f15caf3"},"previous_names":["rapidloop/nrpc"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nats-rpc/nrpc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nats-rpc%2Fnrpc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nats-rpc%2Fnrpc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nats-rpc%2Fnrpc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nats-rpc%2Fnrpc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nats-rpc","download_url":"https://codeload.github.com/nats-rpc/nrpc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nats-rpc%2Fnrpc/sbom","scorecard":{"id":676104,"data":{"date":"2025-08-11","repo":{"name":"github.com/nats-rpc/nrpc","commit":"8f47f6a864d10d27a7ff3e326eb7a60f59bdf80a"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":1,"reason":"Found 3/18 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 19 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":9,"reason":"1 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GO-2025-3600 / GHSA-fhg8-qxh5-7q3w"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-21T21:31:24.792Z","repository_id":22845065,"created_at":"2025-08-21T21:31:24.792Z","updated_at":"2025-08-21T21:31:24.792Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28439719,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T22:37:52.437Z","status":"ssl_error","status_checked_at":"2026-01-14T22:37:31.496Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","grpc","protobuf","rpc-framework"],"created_at":"2024-08-03T04:00:49.442Z","updated_at":"2026-01-15T00:32:23.107Z","avatar_url":"https://github.com/nats-rpc.png","language":"Go","funding_links":[],"categories":["Language-Specific","Go"],"sub_categories":["Go"],"readme":"# nRPC\n\n[![Build Status](https://travis-ci.org/nats-rpc/nrpc.svg?branch=master)](https://travis-ci.org/nats-rpc/nrpc)\n\nnRPC is an RPC framework like [gRPC](https://grpc.io/), but for\n[NATS](https://nats.io/).\n\nIt can generate a Go client and server from the same .proto file that you'd\nuse to generate gRPC clients and servers. The server is generated as a NATS\n[MsgHandler](https://godoc.org/github.com/nats-io/nats.go#MsgHandler).\n\nThe [Specifications](https://github.com/nats-rpc/nrpc/wiki/Specifications) \ndescribes how nRPC translates protobuf services and methods into NATS patterns.\n\n## Why NATS?\n\nDoing RPC over NATS'\n[request-response model](http://nats.io/documentation/concepts/nats-req-rep/)\nhas some advantages over a gRPC model:\n\n- **Minimal service discovery**: The clients and servers only need to know the\n  endpoints of a NATS cluster. The clients do not need to discover the\n  endpoints of individual services they depend on.\n- **Load balancing without load balancers**: Stateless microservices can be\n  hosted redundantly and connected to the same NATS cluster. The incoming\n  requests can then be random-routed among these using NATS\n  [queueing](http://nats.io/documentation/concepts/nats-queueing/). There is\n  no need to setup a (high availability) load balancer per microservice.\n\nThe lunch is not always free, however. At scale, the NATS cluster itself can\nbecome a bottleneck. Features of gRPC like streaming and advanced auth are not\navailable.\n\nStill, NATS - and nRPC - offer much lower operational complexity if your\nscale and requirements fit.\n\nAt RapidLoop, we use this model for our [OpsDash](https://www.opsdash.com)\nSaaS product in production and are quite happy with it. nRPC is the third\niteration of an internal library.\n\n## Overview\n\nnRPC comes with a protobuf compiler plugin `protoc-gen-nrpc`, which generates\nGo code from a .proto file.\n\nGiven a .proto file like [helloworld.proto](https://github.com/grpc/grpc-go/blob/master/examples/helloworld/helloworld/helloworld.proto), the usage is like this:\n\n```\n$ ls\nhelloworld.proto\n$ protoc --go_out=. --nrpc_out=. helloworld.proto\n$ ls\nhelloworld.nrpc.go\thelloworld.pb.go\thelloworld.proto\n```\n\nThe .pb.go file, which contains the definitions for the message classes, is\ngenerated by the standard Go plugin for protoc. The .nrpc.go file, which\ncontains the definitions for a client, a server interface, and a NATS handler\nis generated by the nRPC plugin.\n\nHave a look at the generated and example files:\n\n- the service definition [helloworld.proto](https://github.com/nats-rpc/nrpc/tree/master/examples/helloworld/helloworld/helloworld.proto)\n- the generated nrpc go file [helloworld.nrpc.go](https://github.com/nats-rpc/nrpc/tree/master/examples/helloworld/helloworld/helloworld.nrpc.go)\n- an example server [greeter_server/main.go](https://github.com/nats-rpc/nrpc/tree/master/examples/helloworld/greeter_server/main.go)\n- an example client [greeter_client/main.go](https://github.com/nats-rpc/nrpc/tree/master/examples/helloworld/greeter_client/main.go)\n\n### How It Works\n\nThe .proto file defines messages (like HelloRequest and HelloReply in the\nexample) and services (Greeter) that have methods (SayHello).\n\nThe messages are generated as Go structs by the regular Go protobuf compiler\nplugin and gets written out to \\*.pb.go files.\n\nFor the rest, nRPC generates three logical pieces.\n\nThe first is a Go interface type (GreeterServer) which your actual\nmicroservice code should implement:\n\n```\n// This is what is contained in the .proto file\nservice Greeter {\n    rpc SayHello (HelloRequest) returns (HelloReply) {}\n}\n\n// This is the generated interface which you've to implement\ntype GreeterServer interface {\n    SayHello(ctx context.Context, req HelloRequest) (resp HelloReply, err error)\n}\n```\n\nThe second is a client (GreeterClient struct). This struct has\nmethods with appropriate types, that correspond to the service definition. The\nclient code will marshal and wrap the request object (HelloRequest) and do a\nNATS `Request`.\n\n```\n// The client is associated with a NATS connection.\nfunc NewGreeterClient(nc *nats.Conn) *GreeterClient {...}\n\n// And has properly typed methods that will marshal and perform a NATS request.\nfunc (c *GreeterClient) SayHello(req HelloRequest) (resp HelloReply, err error) {...}\n```\n\nThe third and final piece is the handler (GreeterHandler). Given a NATS\nconnection and a server implementation, it can accept NATS requests in the\nformat sent by the client above. It should be installed as a message handler for\na particular NATS subject (defaults to the name of the service) using the\nNATS Subscribe() or QueueSubscribe() methods. It will invoke the appropriate\nmethod of the GreeterServer interface upon receiving the appropriate request.\n\n```\n// A handler is associated with a NATS connection and a server implementation.\nfunc NewGreeterHandler(ctx context.Context, nc *nats.Conn, s GreeterServer) *GreeterHandler {...}\n\n// It has a method that can (should) be used as a NATS message handler.\nfunc (h *GreeterHandler) Handler(msg *nats.Msg) {...}\n```\n\nStanding up a microservice involves:\n\n- writing the .proto service definition file\n- generating the \\*.pb.go and \\*.nrpc.go files\n- implementing the server interface\n- writing a main app that will connect to NATS and start the handler ([see\n  example](https://github.com/nats-rpc/nrpc/blob/master/examples/helloworld/greeter_server/main.go))\n\nTo call the service:\n\n- import the package that contains the generated *.nrpc.go files\n- in the client code, connect to NATS\n- create a Caller object and call the methods as necessary ([see example](https://github.com/nats-rpc/nrpc/blob/master/examples/helloworld/greeter_client/main.go))\n\n## Features\n\nThe following wiki pages describe nRPC features in more detail:\n\n- [Load Balancing](https://github.com/nats-rpc/nrpc/wiki/Load-Balancing)\n- [Metrics Instrumentation](https://github.com/nats-rpc/nrpc/wiki/Metrics-Instrumentation)\n  using Prometheus\n\n## Installation\n\nnRPC needs Go 1.11 or higher. $GOPATH/bin needs to be in $PATH for the protoc\ninvocation to work. To generate code, you need the protobuf compiler (which\nyou can install from [here](https://github.com/google/protobuf/releases))\nand the nRPC protoc plugin.\n\nTo install the nRPC protoc plugin:\n\n```\n$ go install github.com/nats-rpc/nrpc/protoc-gen-nrpc@latest\n```\n\nTo build and run the example greeter_server:\n\n```\n$ go install github.com/nats-rpc/nrpc/examples/helloworld/greeter_server@latest\n$ greeter_server\nserver is running, ^C quits.\n```\n\nTo build and run the example greeter_client:\n\n```\n$ go install github.com/nats-rpc/nrpc/examples/helloworld/greeter_client@latest\n$ greeter_client\nGreeting: Hello world\n$\n```\n\n## Documentation\n\nTo learn more about describing gRPC services using .proto files, see [here](https://grpc.io/docs/guides/concepts.html).\nTo learn more about NATS, start with their [website](https://nats.io/). To\nlearn more about nRPC, um, read the source code.\n\n## Status\n\nnRPC is in alpha. This means that it will work, but APIs may change without\nnotice.\n\nCurrently there is support only for Go clients and servers.\n\nBuilt by RapidLoop. Released under Apache 2.0 license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnats-rpc%2Fnrpc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnats-rpc%2Fnrpc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnats-rpc%2Fnrpc/lists"}