jsonrpc

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	JSONRPCError_ParseError     JSONRPCErrorCode = -32700
	JSONRPCError_InvalidRequest                  = -32600
	JSONRPCError_NotFound                        = -32601
	JSONRPCError_InvalidParams                   = -32602
	JSONRPCError_InternalError                   = -32603
	JSONRPCError_ServerError                     = -32000
)

Variables

Functions

This section is empty.

Types

type JSONRPC

type JSONRPC struct {
}

func (*JSONRPC) ParseRequest

func (je *JSONRPC) ParseRequest(r io.Reader) (*websocket_server.RPCRequest, error)

func (*JSONRPC) PrepareNotification

func (je *JSONRPC) PrepareNotification(eventName string, payload interface{}) ([]byte, error)

func (*JSONRPC) PrepareResponse

func (je *JSONRPC) PrepareResponse(res *websocket_server.RPCResponse) ([]byte, error)

type JSONRPCError

type JSONRPCError struct {
	JSONRPC string           `json:"jsonrpc"`
	ID      int64            `json:"id"`
	Error   JSONRPCErrorInfo `json:"error"`
}

type JSONRPCErrorCode

type JSONRPCErrorCode int32

type JSONRPCErrorInfo

type JSONRPCErrorInfo struct {
	Code    JSONRPCErrorCode `json:"code"`
	Message string           `json:"message"`
	Data    interface{}      `json:"data,omitempty"`
}

type JSONRPCRequest

type JSONRPCRequest struct {
	JSONRPC string      `json:"jsonrpc"`
	ID      int64       `json:"id"`
	Method  string      `json:"method"`
	Params  interface{} `json:"params"`
}

type JSONRPCResponse

type JSONRPCResponse struct {
	JSONRPC string      `json:"jsonrpc"`
	ID      int64       `json:"id"`
	Result  interface{} `json:"result"`
}

type NotificationEntry

type NotificationEntry struct {
	JSONRPC string      `json:"jsonrpc"`
	Method  string      `json:"method"`
	Params  interface{} `json:"params"`
}

Jump to

Keyboard shortcuts

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