proxy.golang.org : github.com/orian/go-rpcgen
The go-rpcgen project is an attempt to create an easy-to-use, open source protobuf service binding for the standard Go RPC package. It provides a protoc-gen-go (based on the standard "main" from goprotobuf and leveraging its libraries) which has a plugin added to also output RPC stub code. You will need the protobuf compiler for your operating system of choice. You can retrieve this from http://code.google.com/p/protobuf/downloads/list if you do not have it already. As this package builds a plugin for the protoc from that package, you will need to have your $GOPATH/bin in your path when you run protoc. To install, run the following command: Usage of the package is pretty straightforward. Once you have installed the protoc-gen-go plugin, you can compile protobufs with the following command (where file.proto is the protocol buffer file(s) in question): This will generate a file named like file.pb.go which contains, in addition to the usual Go bindings for the messages, an interface for each service containing the methods for that service and functions for creating and using them with the RPC package and a webrpc package. By default, protoc-gen-go will generate both RPC and web-based stubs, but this can be configured by setting the GO_STUBS environment variable. This variable is a comma-separated list of the stubs to generate. The known stubs are: Given the following basic .proto definition: The protoc-gen-go plugin will generate a service definition similar to below: Any type which implements EchoService can thus be registered via ServeEchoService or ListenAndServeEchoService to be called remotely via NewEchoServiceClient or DialEchoService. In addition to the above, the following are also generated to facilitate serving RPCs over the web (e.g. AppEngine; see example_ae/): Any type which implements EchoServiceWeb (notice that the handlers also receive the *http.Request) can be registered. The RegisterEchoServiceWeb function registers the given backend implementation to be called from the web via the webrpc package. See the examples/ subdirectory for some complete examples demonstrating basic usage. See the example_ae/ subdirectory for an appengine example and for directions about how to deploy go-rpcgen on appengine. Thanks to the following people:
Registry
-
Source
- Documentation
- JSON
purl: pkg:golang/github.com/orian/go-rpcgen
License: BSD-3-Clause
Latest release: over 12 years ago
First release: about 13 years ago
Namespace: github.com/orian
Stars: 0 on GitHub
Forks: 0 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: 22 days ago