Documentation
¶
Index ¶
Constants ¶
View Source
const RPC_VERSION = "2.0"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JsonRPC ¶
type JsonRPC interface {
//Register a service
Register(srv any) error
//Register a service and specify name
RegisterWithName(srv any, name string) error
// The `ServeHTTP` function is responsible for handling incoming JSON-RPC requests. It takes in an
// `http.ResponseWriter` and an `http.Request` as parameters.
ServeHTTP(w http.ResponseWriter, r *http.Request)
}
func NewJsonRpc ¶
func NewJsonRpc() JsonRPC
type RpcErrorCode ¶
type RpcErrorCode int
32000 to 32099 Server error Reserved for implementation-defined server-errors.
const ( PARSE_ERROR RpcErrorCode = 32700 INVALID_REQUEST RpcErrorCode = 32600 METHOD_NOT_FOUND RpcErrorCode = 32601 INVALID_PARAMS RpcErrorCode = 32602 INTERNAL_ERROR RpcErrorCode = 32603 )
Click to show internal directories.
Click to hide internal directories.