Documentation
¶
Overview ¶
Package jsonrpc2 implements JSON-RPC 2.0 method handlers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitMetrics ¶
func InitMetrics(reg *prometheus.Registry)
InitMetrics must be called once before using this package. It registers and initializes metrics used by this package.
Types ¶
type Config ¶
type Config struct { Pattern string // Pattern for http.ServeMux. StrictErr bool // Set to true to panic if RPC method returns undocumented error. }
Config contains configuration for JSON-RPC 2.0 service.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server implements JSON-RPC 2.0 method handlers.
func (*Server) Example ¶
func (srv *Server) Example(arg api.RPCExampleReq, res *api.RPCExampleResp) error
Example implements JSON-RPC 2.0 method.
func (*Server) IncExample ¶
func (srv *Server) IncExample(arg api.RPCIncExampleReq, res *api.RPCIncExampleResp) error
IncExample implements JSON-RPC 2.0 method.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.