daemonrpc

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2018 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RPCFailed

func RPCFailed(err error, w http.ResponseWriter)

RPCFailed handles errors encountered when requesting daemon

func RequestDaemon

func RequestDaemon(coinData conf.CoinData, rpcReqData RPCRequestData, daemonConf conf.DaemonConfig) (*http.Response, error)

RequestDaemon requests the data via the daemon's RPC api allows auto switches between the testnet and live depending on the config

Types

type RPCRequestData

type RPCRequestData struct {
	Method string      `json:"method"`
	Params interface{} `json:"params"`
}

RPCRequestData defines method and params

type RPCResponse

type RPCResponse struct {
	Code    int    `json:"code"`
	Data    string `json:"data"`
	Message string `json:"message"`
}

RPCResponse defines code, data, and message

Jump to

Keyboard shortcuts

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