Documentation ¶
Overview ¶
Package rpc provides functions to for rpc server call
Index ¶
- func Call(address string, method string, id interface{}, params []interface{}) ([]byte, error)
- func Handle(w http.ResponseWriter, r *http.Request)
- func HandleFunc(pattern string, handler func([]interface{}) map[string]interface{})
- func ResponsePack(errcode int64, result interface{}) map[string]interface{}
- func ResponseSuccess(result interface{}) map[string]interface{}
- func SetDefaultFunc(def func(http.ResponseWriter, *http.Request))
- type JReq
- type ServeMux
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Handle ¶
func Handle(w http.ResponseWriter, r *http.Request)
this is the function that should be called in order to answer an rpc call should be registered like "http.HandleFunc("/", httpjsonrpc.Handle)"
func HandleFunc ¶
a function to register functions to be called for specific rpc calls
func ResponsePack ¶ added in v1.14.1
func ResponseSuccess ¶ added in v1.14.1
func ResponseSuccess(result interface{}) map[string]interface{}
func SetDefaultFunc ¶
func SetDefaultFunc(def func(http.ResponseWriter, *http.Request))
a function to be called if the request is not a HTTP JSON RPC call
Types ¶
Click to show internal directories.
Click to hide internal directories.