Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CustomHandler ¶ added in v1.1.0
CustomHandler used for custom incoming messages point (like WS)
func HttpHandler ¶ added in v1.1.0
func HttpHandler(w http.ResponseWriter, r *http.Request)
HttpHandler Main point function of http handler
func RegisterFunc ¶
RegisterFunc Add method based on lambda func
Types ¶
type RPCError ¶
RPCError Error struct
func EmptyRequestError ¶
func EmptyRequestError() (interface{}, *RPCError)
EmptyRequestError Wrong data or Empty request Helper function for most cases
type RPCMethod ¶
type RPCMethod interface {
Handler(params interface{}) (interface{}, *RPCError)
}
RPCMethod Interface for struct style method
type RPCRequest ¶
type RPCRequest struct {
Version string `mstruct:"jsonrpc"` // Protocol version
Method string `mstruct:"method"` // Method name
Params interface{} `mstruct:"params"` // Method params
ID int `mstruct:"id"` // Request id
}
RPCRequest RPC struct
Click to show internal directories.
Click to hide internal directories.