Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultErrorHandler = func(err jsonrpc.Error) *rpcErrors.Error { if err != nil { return &rpcErrors.Error{ Code: rpcErrors.Code(err.GetCode()), Message: err.GetMessage(), Data: err.GetData(), } } return nil }
DefaultErrorHandler just proxy error interface into error struct.
Functions ¶
This section is empty.
Types ¶
type ErrorHandler ¶
ErrorHandler allows to customize errors handling process.
type Kernel ¶
type Kernel struct { InvokingErrorHandler ErrorHandler // contains filtered or unexported fields }
Kernel is default kernel implementation.
func New ¶
func New(router jsonrpc.Router) *Kernel
New creates new kernel for a working with PRC requests using Router.
func (*Kernel) HandleJSONRequest ¶
HandleJSONRequest accepts json request and returns processed json response.
func (*Kernel) ParseJSONToRequests ¶
func (kernel *Kernel) ParseJSONToRequests(inJSON []byte) (requests *[]rpcRequest.Request, isBatch bool, err error)
ParseJSONToRequests accepts json string and convert it into requests slice.
Click to show internal directories.
Click to hide internal directories.