Documentation ¶
Index ¶
- Constants
- func InsertCoin(dbClient *Database, ip Coin) (err error)
- func InsertCoinDynamics(dbClient *Database, dynamics CoinDynamics) (err error)
- func InsertIP(dbClient *Database, ip CoinIp) (err error)
- func InsertTPoSContract(dbClient *Database, contract TPoSContract) (err error)
- func SetActive(dbClient *Database, coin string, ips []string) (err error)
- func SetAllInactive(dbClient *Database, coin string) (err error)
- func SetAllTPoSContractsInactive(dbClient *Database) (err error)
- func SetMysqlConnect(str string)
- func SetTPoSContractsActive(dbClient *Database, hashTx []string) (err error)
- func TruncateCoinDynamics(dbClient *Database) (err error)
- func UpdateTPosContract(dbClient *Database, contract TPoSContract) (err error)
- type Coin
- type CoinDynamics
- type CoinIp
- type Database
- func (db *Database) Exec(query string, args ...interface{}) (result Result, err error)
- func (db *Database) Get(dest interface{}, query string, args ...interface{}) error
- func (db *Database) Insert(table string, object interface{}) (r Result, err error)
- func (db *Database) MustExec(query string, args ...interface{}) Result
- func (db *Database) NamedExec(query string, arg interface{}) (Result, error)
- func (db *Database) Select(dest interface{}, query string, args ...interface{}) error
- type Result
- type TPoSContract
- type Tx
Constants ¶
View Source
const (
ListSeparator = ","
)
Variables ¶
This section is empty.
Functions ¶
func InsertCoin ¶
func InsertCoinDynamics ¶
func InsertCoinDynamics(dbClient *Database, dynamics CoinDynamics) (err error)
func InsertTPoSContract ¶
func InsertTPoSContract(dbClient *Database, contract TPoSContract) (err error)
func SetAllInactive ¶
func SetMysqlConnect ¶
func SetMysqlConnect(str string)
func SetTPoSContractsActive ¶
func TruncateCoinDynamics ¶
func UpdateTPosContract ¶
func UpdateTPosContract(dbClient *Database, contract TPoSContract) (err error)
Types ¶
type Coin ¶
type Coin struct { Name string `db:"name"` Symbol string `db:"symbol"` CMCId int `db:"cmc_id"` Labels string `db:"labels"` Consensus string `db:"consensus"` ImagePath string `db:"image_path"` Website string `db:"website"` Explorer string `db:"explorer"` Github string `db:"github"` Twitter string `db:"twitter"` Discord string `db:"discord"` Reddit string `db:"reddit"` Telegram string `db:"telegram"` Articles string `db:"articles"` State string `db:"state"` DateAdded time.Time `db:"date_added"` Description string `db:"description"` DescriptionHTML template.HTML }
func GetAllCoins ¶
func (*Coin) SetConsensusString ¶
func (*Coin) SetLabelString ¶
func (*Coin) StringToConsensus ¶
func (*Coin) StringToLabels ¶
type CoinDynamics ¶
type CoinDynamics struct { Symbol string `db:"symbol"` CMCId int `db:"cmc_id"` CMCRank int `db:"cmc_rank"` PriceUSD string `db:"price_usd"` Price1H string `db:"price_1h"` Price24H string `db:"price_24h"` Price7D string `db:"price_7d"` SupplyCirculating string `db:"supply_circulating"` SupplyTotal string `db:"supply_total"` SupplyMax string `db:"supply_max"` UpdatedAt time.Time `db:"updated_at"` }
func GetAllCoinDynamics ¶
func GetAllCoinDynamics(dbClient *Database) (ips []CoinDynamics, err error)
func GetCoinDynamics ¶
func GetCoinDynamics(dbClient *Database, symbol string) (ips CoinDynamics, err error)
type CoinIp ¶
type CoinIp struct { Ip string `db:"ip"` IpType string `db:"ip_type"` CoinName string `db:"coin_name"` CountryCode string `db:"country_code"` CountryName string `db:"country_name"` ContinentName string `db:"continent_name"` City string `db:"city"` Zip string `db:"zip"` Hostname string `db:"hostname"` Provider string `db:"provider"` Latitude float64 `db:"latitude"` Longitude float64 `db:"longitude"` LastChecked time.Time `db:"last_checked_at"` Active bool `db:"active"` }
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
type TPoSContract ¶
type TPoSContract struct { Id int `db:"id"` MerchantAddress string `db:"merchant_address"` OwnerAddress string `db:"owner_address"` ActiveSince time.Time `db:"active_since"` HashTx string `db:"hash_tx"` Commission float64 `db:"commission"` Active bool `db:"active"` IP string `db:"ip"` }
func GetActiveTPoSContracts ¶
func GetActiveTPoSContracts(dbClient *Database) (contracts []TPoSContract, err error)
func GetTPoSContracts ¶
func GetTPoSContracts(dbClient *Database) (contracts []TPoSContract, err error)
Click to show internal directories.
Click to hide internal directories.