insight

package
v2.1.3+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2018 License: ISC Imports: 34 Imported by: 0

Documentation

Overview

Package insight handles the insight api

Index

Constants

View Source
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

func UseLogger

func UseLogger(logger slog.Logger)

UseLogger uses a specified Logger to output package logging info.

Types

type ApiMux

type ApiMux struct {
	*chi.Mux
}

ApiMux contains the struct mux

func NewInsightApiRouter

func NewInsightApiRouter(app *insightApiContext, userRealIP bool) ApiMux

NewInsightApiRouter returns a new HTTP path router, ApiMux, for the Insight API.

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 NewTx

type NewTx struct {
	Hex   string
	Vouts []dcrjson.Vout
}

NewTx models data from the notification handler

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 creates and returns new instance of the SocketServer

func (*SocketServer) Store

func (soc *SocketServer) Store(blockData *blockdata.BlockData, _ *wire.MsgBlock) error

Store broadcasts the lastest block hash to the the inv room

type WebSocketTx

type WebSocketTx struct {
	Hash     string           `json:"txid"`
	Size     int              `json:"size"`
	TotalOut int64            `json:"valueOut"`
	Vout     map[string]int64 `json:"vout,omitempty"`
}

WebSocketTx models the json data send as the tx event in the inv room

Jump to

Keyboard shortcuts

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