jsonrpc

package
v0.0.0-...-98b6286 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2023 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JsonRPCError

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

func (*JsonRPCError) Error

func (err *JsonRPCError) Error() string

type JsonRPCNotification

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

func NewNotification

func NewNotification(method string, params interface{}) *JsonRPCNotification

func (*JsonRPCNotification) Get

func (notify *JsonRPCNotification) Get(name string) (interface{}, error)

func (*JsonRPCNotification) GetString

func (notify *JsonRPCNotification) GetString(name string) (string, error)

func (*JsonRPCNotification) Parse

func (reply *JsonRPCNotification) Parse(bytes []byte) error

type JsonRPCRequest

type JsonRPCRequest struct {
	JSONRPC string      `json:"jsonrpc"`
	ID      interface{} `json:"id"`
	Method  string      `json:"method"`
	Params  interface{} `json:"params,omitempty"`
}

func NewRequest

func NewRequest(id interface{}, method string, params interface{}) *JsonRPCRequest

func (*JsonRPCRequest) Buffer

func (request *JsonRPCRequest) Buffer() ([]byte, error)

func (*JsonRPCRequest) Parse

func (request *JsonRPCRequest) Parse(bytes []byte) error

type JsonRPCResponse

type JsonRPCResponse struct {
	JSONRPC string        `json:"jsonrpc"`
	ID      interface{}   `json:"id"`
	Result  interface{}   `json:"result,omitempty"`
	Error   *JsonRPCError `json:"error,omitempty"`
}

func (*JsonRPCResponse) GetString

func (reply *JsonRPCResponse) GetString(name string) (string, error)

func (*JsonRPCResponse) IsError

func (reply *JsonRPCResponse) IsError() bool

func (*JsonRPCResponse) Parse

func (reply *JsonRPCResponse) Parse(bytes []byte) error

Jump to

Keyboard shortcuts

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