{"id":37141913,"url":"https://github.com/pluginrpc/pluginrpc-go","last_synced_at":"2026-01-14T16:39:21.376Z","repository":{"id":255257753,"uuid":"849007919","full_name":"pluginrpc/pluginrpc-go","owner":"pluginrpc","description":"The Go library for PluginRPC: A Protobuf RPC framework for plugins.","archived":false,"fork":false,"pushed_at":"2024-11-25T03:34:31.000Z","size":81,"stargazers_count":18,"open_issues_count":4,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-12T08:18:39.522Z","etag":null,"topics":["protobuf","protocol-buffers","rpc"],"latest_commit_sha":null,"homepage":"https://pluginrpc.com","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/pluginrpc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-28T20:04:02.000Z","updated_at":"2024-12-25T00:31:57.000Z","dependencies_parsed_at":"2024-08-28T22:24:07.468Z","dependency_job_id":"65e7c610-b382-4878-9ce6-d8d3b04aa426","html_url":"https://github.com/pluginrpc/pluginrpc-go","commit_stats":null,"previous_names":["pluginrpc/pluginrpc-go"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/pluginrpc/pluginrpc-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pluginrpc%2Fpluginrpc-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pluginrpc%2Fpluginrpc-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pluginrpc%2Fpluginrpc-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pluginrpc%2Fpluginrpc-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pluginrpc","download_url":"https://codeload.github.com/pluginrpc/pluginrpc-go/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pluginrpc%2Fpluginrpc-go/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28426119,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T16:32:27.303Z","status":"ssl_error","status_checked_at":"2026-01-14T16:28:36.419Z","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":["protobuf","protocol-buffers","rpc"],"created_at":"2026-01-14T16:39:20.771Z","updated_at":"2026-01-14T16:39:21.367Z","avatar_url":"https://github.com/pluginrpc.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pluginrpc-go\n\n[![Build](https://github.com/pluginrpc/pluginrpc-go/actions/workflows/ci.yaml/badge.svg?branch=main)](https://github.com/pluginrpc/pluginrpc-go/actions/workflows/ci.yaml)\n[![Report Card](https://goreportcard.com/badge/pluginrpc.com/pluginrpc)](https://goreportcard.com/report/pluginrpc.com/pluginrpc)\n[![GoDoc](https://pkg.go.dev/badge/pluginrpc.com/pluginrpc.svg)](https://pkg.go.dev/pluginrpc.com/pluginrpc)\n[![Slack](https://img.shields.io/badge/slack-buf-%23e01563)](https://buf.build/links/slack)\n\nThe Golang library for [PluginRPC](https://github.com/pluginrpc/pluginrpc).\n\nThe [pluginrpc.com/pluginrpc](https://pkg.go.dev/pluginrpc.com/pluginrpc) library provides all the\nprimitives necessary to operate with the PluginRPC ecosystem. The `protoc-gen-pluginrpc-go` plugin\ngenerates stubs for Protobuf services to work with PluginRPC. It makes authoring and consuming\nplugins based on Protobuf services incredibly simple.\n\nFor more on the motivation behind PluginRPC, see the\n[github.com/pluginrpc/pluginrpc](https://github.com/pluginrpc/pluginrpc) documentation.\n\nFor a full example, see the [internal/example](internal/example) directory. This contains:\n\n- [proto/pluginrpc/example/v1](internal/example/proto/pluginrpc/example/v1): An Protobuf package\n  that contains an example Protobuf service `EchoService`.\n- [gen/pluginrpc/example/v1](internal/example/gen/pluginrpc/example/v1): The generated code from\n  `protoc-gen-go` and `protoc-gen-pluginrpc-go` for the example Protobuf Package.\n- [echo-plugin](internal/example/cmd/echo-plugin): An implementation of a PluginRPC plugin for\n  `EchoService`.\n- [echo-request-client](internal/example/cmd/echo-request-client): A simple client that calls the\n  `EchoRequest` RPC via invoking `echo-plugin`.\n- [echo-list-client](internal/example/cmd/echo-request-client): A simple client that calls the\n  `EchoList` RPC via invoking `echo-plugin`.\n- [echo-error-client](internal/example/cmd/echo-error-client): A simple client that calls the\n  `EchoError` RPC via invoking `echo-plugin`.\n\n## Usage\n\nInstall the `protoc-gen-go` and `protoc-gen-pluginrpc-go` plugins:\n\n```bash\n$ go install \\\n    google.golang.org/protobuf/cmd/protoc-gen-go@latest \\\n    pluginrpc.com/pluginrpc/cmd/protoc-gen-pluginrpc-go@latest\n```\n\nGenerate stubs. The easiest way to do so is by using [buf](github.com/bufbuild/buf). See Buf's\n[generation tutorial] for more details on setting up generation. You'll likely need a `buf.gen.yaml`\nfile that looks approximately like the following:\n\n```yaml\nversion: v2\ninputs:\n  # Or wherever your .proto files live\n  - directory: proto\nmanaged:\n  enabled: true\n  override:\n    - file_option: go_package_prefix\n      # Replace github.com/acme/foo with the name of your Golang module\n      value: github.com/acme/foo/gen\nplugins:\n  - local: protoc-gen-go\n    out: gen\n    opt: paths=source_relative\n  - local: protoc-gen-pluginrpc-go\n    out: gen\n    opt: paths=source_relative\n```\n\nBuild your plugin. See [echo-plugin](internal/example/cmd/echo-plugin) for a full example. Assuming\nyou intend to expose the `EchoService` as a plugin, your code will look something like this:\n\n```go\nfunc main() {\n\tpluginrpc.Main(newServer)\n}\n\nfunc newServer() (pluginrpc.Server, error) {\n\tspec, err := examplev1pluginrpc.EchoServiceSpecBuilder{\n\t\t// Note that EchoList does not have optional args and will default to path being the only arg.\n\t\t//\n\t\t// This means that the following commands will invoke their respective procedures:\n\t\t//\n\t\t//   echo-plugin echo request\n\t\t//   echo-plugin /pluginrpc.example.v1.EchoService/EchoList\n\t\t//   echo-plugin echo error\n\t\tEchoRequest: []pluginrpc.ProcedureOption{pluginrpc.ProcedureWithArgs(\"echo\", \"request\")},\n\t\tEchoError:   []pluginrpc.ProcedureOption{pluginrpc.ProcedureWithArgs(\"echo\", \"error\")},\n\t}.Build()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tserverRegistrar := pluginrpc.NewServerRegistrar()\n\techoServiceServer := examplev1pluginrpc.NewEchoServiceServer(pluginrpc.NewHandler(spec), echoServiceHandler{})\n\texamplev1pluginrpc.RegisterEchoServiceServer(serverRegistrar, echoServiceServer)\n\treturn pluginrpc.NewServer(spec, serverRegistrar)\n}\n\ntype echoServiceHandler struct{}\n\nfunc (echoServiceHandler) EchoRequest(_ context.Context, request *examplev1.EchoRequestRequest) (*examplev1.EchoRequestResponse, error) {\n    ...\n}\n\nfunc (echoServiceHandler) EchoList(context.Context, *examplev1.EchoListRequest) (*examplev1.EchoListResponse, error) {\n    ...\n}\n\nfunc (echoServiceHandler) EchoError(_ context.Context, request *examplev1.EchoErrorRequest) (*examplev1.EchoErrorResponse, error) {\n    ...\n}\n```\n\nInvoke your plugin. You'll create a client that points to your plugin. See\n[echo-request-client](internal/example/cmd/echo-request-client) for a full example. Invocation will\nlook something like this:\n\n```go\nclient := pluginrpc.NewClient(pluginrpc.NewExecRunner(\"echo-plugin\"))\nechoServiceClient, err := examplev1pluginrpc.NewEchoServiceClient(client)\nif err != nil {\n    return err\n}\nresponse, err := echoServiceClient.EchoRequest(\n    context.Background(),\n    \u0026examplev1.EchoRequestRequest{\n        ...\n    },\n)\n```\n\nSee [pluginrpc_test.go](pluginrpc_test.go) for an example of how to test plugins.\n\n## Plugin Options\n\nThe `protoc-gen-pluginrpc-go` has an option `streaming` that specifies how to handle streaming RPCs.\nPluginRPC does not support streaming methods. There are three valid values for `streaming`: `error`,\n`warn`, `ignore`. The default is `warn`:\n\n- `streaming=error`: The plugin will error if a streaming method is encountered.\n- `streaming=warn`: The plugin will produce a warning to stderr if a streaming method is\n  encountered.\n- `streaming=ignore`: The plugin will ignore streaming methods and not produce a warning.\n\nIn the case of `warn` or `ignore`, streaming RPCs will be skipped and no functions will be generated\nfor them. If a service only has streaming RPCs, no interfaces will be generated for this service. If\na file only has services with only streaming RPCs, no file will be generated.\n\nAdditionally, `protoc-gen-pluginrpc-go has all the\n[standard Go plugin options](https://pkg.go.dev/google.golang.org/protobuf@v1.34.2/compiler/protogen):\n\n- `module=\u003cmodule\u003e`\n- `paths={import,source_relative}`\n- `annotate_code={true,false}`\n- `M\u003cfile\u003e=\u003cpackage\u003e`\n\n\n## Status: Beta\n\nThis framework is in active development, and should not be considered stable.\n\n## Legal\n\nOffered under the [Apache 2 license](https://github.com/pluginrpc/pluginrpc-go/blob/main/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpluginrpc%2Fpluginrpc-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpluginrpc%2Fpluginrpc-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpluginrpc%2Fpluginrpc-go/lists"}