Documentation ¶
Overview ¶
Package insight handles the insight api
Index ¶
Constants ¶
const APIVersion = 0
APIVersion is an integer value, incremented for breaking changes
Variables ¶
This section is empty.
Functions ¶
func DisableLog ¶
func DisableLog()
DisableLog disables all library log output. Logging output is disabled by default until UseLogger is called.
func NewInsightContext ¶
func NewInsightContext(client *rpcclient.Client, blockData *dcrpg.ChainDBRPC, params *chaincfg.Params, memPoolData DataSourceLite, JSONIndent string) *insightApiContext
NewInsightContext Constructor for insightApiContext
Types ¶
type ApiMux ¶
ApiMux contains the struct mux
func NewInsightApiRouter ¶
NewInsightApiRouter returns a new HTTP path router, ApiMux, for the Insight API, app.
type DataSourceLite ¶
type DataSourceLite interface {
UnconfirmedTxnsForAddress(address string) (*txhelpers.AddressOutpoints, int64, error)
}
DataSourceLite specifies an interface for collecting data from the built-in databases (i.e. SQLite, storm, ffldb)
type InsightSocketVout ¶
InsightSocketVout represents a single vout for the Insight "vout" JSON object that appears in a "tx" message from the "inv" room.
func (*InsightSocketVout) MarshalJSON ¶
func (v *InsightSocketVout) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler so that an InsightSocketVout will marshal to JSON like:
{ "DsZQaCQES5vh3JmcyyFokJYz3aSw8Sm1dsQ": 13741789 }
type SocketServer ¶
type SocketServer struct { socketio.Server // contains filtered or unexported fields }
SocketServer wraps the socket.io server with the watched address list.
func NewSocketServer ¶
func NewSocketServer(newTxChan chan *NewTx, params *chaincfg.Params) (*SocketServer, error)
NewSocketServer constructs a new SocketServer, registering handlers for the "connection", "disconnection", and "subscribe" events.
type WebSocketTx ¶
type WebSocketTx struct { Hash string `json:"txid"` Size int `json:"size"` TotalOut int64 `json:"valueOut"` Vouts []InsightSocketVout `json:"vout,omitempty"` }
WebSocketTx models the JSON data sent as the tx event in the inv room.