Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterMethod ¶
func RegisterMethod(method string, handlerFunc HandlerFunc, paramsType interface{})
RegisterMethod register a method to the default handler.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler is a handler handling JSON-RPC protocol.
func (*Handler) RegisterMethod ¶
func (h *Handler) RegisterMethod(method string, handlerFunc HandlerFunc, paramsType interface{})
RegisterMethod register a method.
type HandlerFunc ¶
HandlerFunc is a function adapter to Handler.
type Validator ¶
type Validator interface {
Validate() error
}
Validator is designed for params checking.
type WebsocketServer ¶
WebsocketServer is a websocket server providing JSON-RPC API service.
func (*WebsocketServer) Serve ¶
func (ws *WebsocketServer) Serve() error
Serve accepts incoming connections and serve each.
func (*WebsocketServer) Stop ¶
func (ws *WebsocketServer) Stop()
Stop stops the server and returns a channel indicating server is stopped.
Click to show internal directories.
Click to hide internal directories.