jrpc: github.com/mrFokin/jrpc Index | Files

package jrpc

import "github.com/mrFokin/jrpc"

Package jrpc implements JSON-RPC 2.0 for labstack echo server


Package Files

context.go error.go jrpc.go protocol.go

func NewError Uses

func NewError(code int, message string, data interface{}) error

NewError creates instance of error

func NewErrorInvalidParams Uses

func NewErrorInvalidParams(data interface{}) error

NewErrorInvalidParams - helper func for create instance of Invalid params error

type Context Uses

type Context interface {
    Bind(interface{}) error
    Result(interface{}) error

Context - json-rpc context

type Error Uses

type Error interface {
    Error() string

Error - json-rpc error interface

func HandleMethod Uses

func HandleMethod(ec echo.Context, method HandlerFunc, params json.RawMessage) (json.RawMessage, Error)

HandleMethod run jrpc handler

type HandlerFunc Uses

type HandlerFunc func(c Context) error

HandlerFunc - json-rpc handler

type JRPC Uses

type JRPC interface {
    Method(method string, handler HandlerFunc)

JRPC interface

func Endpoint Uses

func Endpoint(e *echo.Echo, path string, m ...echo.MiddlewareFunc) JRPC

Endpoint create instance of jrpc route

Package jrpc imports 6 packages (graph). Updated 2019-11-08. Refresh now. Tools for package owners.