api_jsonRPC_protocol

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2026 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RPCError

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

func (*RPCError) Error

func (e *RPCError) Error() string

type RPCRequest

type RPCRequest struct {
	Method  string          `json:"method"`
	Params  interface{}     `json:"params"`
	JsonRPC string          `json:"jsonrpc"`
	ID      json.RawMessage `json:"id,omitempty"`
}

RPCRequest JSON-RPC 请求和响应结构

func (*RPCRequest) IDString

func (r *RPCRequest) IDString() string

func (*RPCRequest) IsNotification

func (r *RPCRequest) IsNotification() bool

type RPCResponse

type RPCResponse struct {
	Result  interface{}     `json:"result,omitempty"`
	Error   *RPCError       `json:"error,omitempty"`
	JsonRPC string          `json:"jsonrpc"`
	ID      json.RawMessage `json:"id"`
}

Jump to

Keyboard shortcuts

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