Documentation ¶
Overview ¶
Package jrpc implements JSON-RPC 2.0 for labstack echo server
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewErrorInvalidParams ¶
func NewErrorInvalidParams(data interface{}) error
NewErrorInvalidParams - helper func for create instance of Invalid params error
Types ¶
type Context ¶
type Context interface { EchoContext() echo.Context Bind(interface{}) error Result(interface{}) error }
Context - json-rpc context
type Error ¶
type Error interface {
Error() string
}
Error - json-rpc error interface
func HandleMethod ¶
func HandleMethod(ec echo.Context, method HandlerFunc, params json.RawMessage) (json.RawMessage, Error)
HandleMethod run jrpc handler
type JRPC ¶
type JRPC interface {
Method(method string, handler HandlerFunc, middleware ...MiddlewareFunc)
}
JRPC interface
type MiddlewareFunc ¶ added in v0.9.2
type MiddlewareFunc func(HandlerFunc) HandlerFunc
MiddlewareFunc defines a function to process json-rpc middleware.
Click to show internal directories.
Click to hide internal directories.