jsonrpc

package
v0.0.0-...-c84ee5c Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorResponse

func ErrorResponse(w http.ResponseWriter, r *http.Request, err error, status int, message string)

func NewErrorJSON

func NewErrorJSON(id interface{}, code int, message string) *simplejson.Json

Types

type CID

type CID uint64

type RPCMessage

type RPCMessage struct {
	Initialized bool
	FromConnId  CID
	Id          interface{}
	ServiceName string
	Method      string
	Params      *simplejson.Json
	Result      *simplejson.Json
	Error       *simplejson.Json
	Raw         *simplejson.Json
}

func NewErrorMessage

func NewErrorMessage(id interface{}, code int, message string) RPCMessage

func NewNotifyMessage

func NewNotifyMessage(serviceName string, method string, params []interface{}) RPCMessage

func NewRPCMessage

func NewRPCMessage(data *simplejson.Json) RPCMessage

func NewResultMessage

func NewResultMessage(id interface{}, result interface{}) RPCMessage

func ParseMessage

func ParseMessage(data []byte) (RPCMessage, error)

func (RPCMessage) GetIntId

func (self RPCMessage) GetIntId() (int64, error)

func (RPCMessage) GetParams

func (self RPCMessage) GetParams() []interface{}

func (RPCMessage) IsError

func (self RPCMessage) IsError() bool

func (RPCMessage) IsNotify

func (self RPCMessage) IsNotify() bool

func (RPCMessage) IsRequest

func (self RPCMessage) IsRequest() bool

func (RPCMessage) IsResult

func (self RPCMessage) IsResult() bool

func (RPCMessage) IsResultOrError

func (self RPCMessage) IsResultOrError() bool

func (RPCMessage) IsValid

func (self RPCMessage) IsValid() bool

Jump to

Keyboard shortcuts

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