An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

Top 8.2% on proxy.golang.org

proxy.golang.org : github.com/terryding77/rpc

Package terryding77/rpc is a foundation for RPC over HTTP services, providing access to the exported methods of an object through HTTP requests. This package derives from the standard net/rpc package but uses a single HTTP request per call instead of persistent connections. Other differences compared to net/rpc: Let's setup a server and register a codec and service: This server handles requests to the "/rpc" path using a JSON codec. A codec is tied to a content type. In the example above, the JSON codec is registered to serve requests with "application/json" as the value for the "Content-Type" header. If the header includes a charset definition, it is ignored; only the media-type part is taken into account. A service can be registered using a name. If the name is empty, like in the example above, it will be inferred from the service type. That's all about the server setup. Now let's define a simple service: The example above defines a service with a method "HelloService.Say" and the arguments and reply related to that method. Use curl to test this: curl -H "Content-Type:application/json" -X POST --data '{"jsonrpc":"2.0","method":"HelloService.Say","params":{"Who":"terry"},"id":1}' http://localhost:8080/rpc The service must be exported (begin with an upper case letter) or local (defined in the package registering the service). When a service is registered, the server inspects the service methods and make available the ones that follow these rules: All other methods are ignored.

Registry - Source - Documentation - JSON
purl: pkg:golang/github.com/terryding77/rpc
License: BSD-3-Clause
Latest release: over 6 years ago
First release: over 6 years ago
Namespace: github.com/terryding77
Stars: 0 on GitHub
Forks: 0 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: about 1 month ago

    Loading...
    Readme
    Loading...