jsonrpc

package module
v1.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 10, 2019 License: MIT Imports: 8 Imported by: 0

README

JSON-RPC protocol library

Codecov Build Status Report GitHub release GitHub

Documentation

Index

Constants

View Source
const (
	ErrNotAFunction    = Error("method must be function")
	ErrNotEnoughArgs   = Error("method needs three args: *http.Request, *args, *reply")
	ErrNotEnoughOut    = Error("method needs one out: error")
	ErrNotReturnError  = Error("method needs one out: error")
	ErrFirstArgRequest = Error("method needs first parameter to be *http.Request")
	ErrSecondArgError  = Error("second argument must be a pointer and must be exported")
	ErrThirdArgError   = Error("third argument must be a pointer and must be exported")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CompressionSelector added in v1.3.0

type CompressionSelector = codec.CompressionSelector

CompressionSelector alias

type Error added in v1.3.0

type Error string

func (Error) Error added in v1.3.0

func (e Error) Error() string

type RPC added in v1.3.0

type RPC struct {
	// contains filtered or unexported fields
}

RPC server struct

func NewRPC added in v1.3.0

func NewRPC() *RPC

NewRPC create new server instance

func (*RPC) AddCodec added in v1.3.0

func (s *RPC) AddCodec(codec codec.Interface, mime string)

AddCodec register codec

func (*RPC) AddMethod added in v1.3.0

func (s *RPC) AddMethod(name string, fn interface{}) error

AddMethod register method func(r *http.Request, args interface{}, reply *Reply) error

func (*RPC) ServeHTTP added in v1.3.0

func (s *RPC) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implementation of http.Handler

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL