Documentation ¶
Index ¶
- func APIQuery(query string, args ...interface{}) (interface{}, error)
- func CloseDB(db *QueryLogger)
- func GetTableStatus() (*g.ChainqueryStatus, error)
- type AddressSummary
- type QueryLogger
- func (d *QueryLogger) Begin() (boil.Transactor, error)
- func (d *QueryLogger) Close() error
- func (d *QueryLogger) Exec(query string, args ...interface{}) (sql.Result, error)
- func (d *QueryLogger) Query(query string, args ...interface{}) (*sql.Rows, error)
- func (d *QueryLogger) QueryRow(query string, args ...interface{}) *sql.Row
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func APIQuery ¶
APIQuery is the entry point from the API to chainquery. The results are turned into json.
func CloseDB ¶
func CloseDB(db *QueryLogger)
CloseDB is a wrapper function to allow error handle when it is usually deferred.
func GetTableStatus ¶
func GetTableStatus() (*g.ChainqueryStatus, error)
GetTableStatus provides size information for the tables in the chainquery database
Types ¶
type AddressSummary ¶
type AddressSummary struct { ID uint64 `boil:"id"` Address string `boil:"address"` TotalReceived float64 `boil:"total_received"` TotalSent float64 `boil:"total_sent"` Balance float64 `boil:"balance"` }
AddressSummary summarizes information for an address from chainquery database
func GetAddressSummary ¶
func GetAddressSummary(address string) (*AddressSummary, error)
GetAddressSummary returns summary information of an address in the chainquery database.
type QueryLogger ¶
QueryLogger implements the Executor interface
func Init ¶
func Init(dsn string, debug bool) (*QueryLogger, error)
Init initializes a database connection based on the dsn provided. It also sets it as the global db connection.
func InitAPIQuery ¶
func InitAPIQuery(dsn string, debug bool) (*QueryLogger, error)
InitAPIQuery initializes the api chainquery db connection
func (*QueryLogger) Begin ¶
func (d *QueryLogger) Begin() (boil.Transactor, error)
Begin implements the Executor Begin function
func (*QueryLogger) Close ¶
func (d *QueryLogger) Close() error
Close implements the Executor Close function
func (*QueryLogger) Exec ¶
func (d *QueryLogger) Exec(query string, args ...interface{}) (sql.Result, error)
Exec implements the Executor Exec function