Documentation
¶
Overview ¶
Package jsonrpc implements Gin middleware for handling JSON-RPC requests via HTTP.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Controller ¶
func Controller(api interface{}) gin.HandlerFunc
Controller returns a custom Gin middleware that handles incoming JSON-RPC requests via HTTP. It maps the RPC method name to struct methods on the given api. For example, if the RPC request has the method field set to "namespace_methodName" then the controller will make a call to api.Namespace_methodName with the params spread as arguments.
If request is valid it will also set the data on the Gin context with the key "json-rpc-request".
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.