client

package
Version: v0.0.0-...-ce5937e Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsValidIDType

func IsValidIDType(id interface{}) bool

IsValidIDType id string number

func MakeRequestData

func MakeRequestData(rpcVersion string, id interface{}, method string, params []interface{}) ([]byte, error)

makeRequestData

Types

type Config

type Config struct {
	Name string

	RPCUser       string
	RPCPassword   string
	RPCServer     string
	RPCCert       string
	NoTLS         bool
	TLSSkipVerify bool

	Proxy     string
	ProxyUser string
	ProxyPass string
}

Config file

type RPCError

type RPCError struct {
	Code    RPCErrorCode `json:"code,omitempty"`
	Message string       `json:"message,omitempty"`
}

RPCError represents an error that is used as a part of a JSON-RPC Response object.

func (RPCError) Error

func (e RPCError) Error() string

type RPCErrorCode

type RPCErrorCode int

A specific type is used to help ensure the wrong errors aren't used.

type Request

type Request struct {
	Jsonrpc string            `json:"jsonrpc"`
	Method  string            `json:"method"`
	Params  []json.RawMessage `json:"params"`
	ID      interface{}       `json:"id"`
}

Request json req

type Response

type Response struct {
	Jsonrpc string          `json:"jsonrpc"`
	Result  json.RawMessage `json:"result"`
	Error   *RPCError       `json:"error"`
	ID      *interface{}    `json:"id"`
}

Jump to

Keyboard shortcuts

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