Documentation ¶
Index ¶
- type Config
- type Database
- func (d *Database) ChangeAccountAccess(user string, access string) bool
- func (d *Database) ChangeAccountPassword(user string, pass []byte) bool
- func (d *Database) CheckTimeMinerCharts(miner *MinerChartSelect, ts int64, minerChartIntvSec int64) bool
- func (d *Database) CollectLuckStats(windowMax int64) ([]*types.BlockData, error)
- func (d *Database) CollectStats(maxBlocks int64) ([]*types.BlockData, []*types.BlockData, []*types.BlockData, int, ...)
- func (d *Database) CreateAccount(user string, pass []byte, access string) bool
- func (d *Database) DelIdInbound(id string) bool
- func (d *Database) DelIpInbound(ip string) bool
- func (d *Database) DelSubIdIndex(devId, subId string) bool
- func (d *Database) DeleteAccount(user string) bool
- func (d *Database) DeleteBlockBalance(min, max int64) int64
- func (d *Database) GetAccountList() ([]*types.UserInfo, error)
- func (d *Database) GetAccountPassword(id string) (string, string, error)
- func (d *Database) GetAlarmInfo() (map[string]*types.InboundIdList, error)
- func (d *Database) GetAllMinerAccount(duration time.Duration, minerChartIntvSec int64) ([]*MinerChartSelect, error)
- func (d *Database) GetAllPayments(maxPayments int64) ([]map[string]interface{}, int64, error)
- func (d *Database) GetBanWhitelist() (mapset.Set, error)
- func (d *Database) GetBlockBalanceMinMax() (int64, int64)
- func (d *Database) GetCandidates(maxHeight int64) ([]*types.BlockData, error)
- func (d *Database) GetChartRewardList(login string, maxList int) ([]*types.RewardData, error)
- func (d *Database) GetIdInboundList() ([]*types.InboundIdList, error)
- func (d *Database) GetImmatureBlocks(maxHeight int64) ([]*types.BlockData, error)
- func (d *Database) GetIpInboundList() ([]*types.InboundIpList, error)
- func (d *Database) GetLikeMinerSubList(addr string) ([]*types.DevSubList, error)
- func (d *Database) GetMinerCharts(hashNum int64, chartIntv int64, login string, ts int64) (stats []*types.MinerCharts, err error)
- func (d *Database) GetMinerStats(login string, maxPayments int64) (map[string]interface{}, error)
- func (d *Database) GetMinerSubInfo(devId string) ([]*types.DevSubList, error)
- func (d *Database) GetMinerSubList() ([]*types.DevSubList, error)
- func (d *Database) GetPayees(max string) ([]*Payees, error)
- func (d *Database) GetPoolBalanceByOnce(maxHeight, minHeight int64, coin string) (*big.Int, int64, error)
- func (d *Database) InsertSqlLog(sql *string)
- func (d *Database) IsIdInboundId(devID string) bool
- func (d *Database) IsMinerExists(login string) (bool, int64, error)
- func (d *Database) SaveIdInbound(id, rule, alarm, desc string) bool
- func (d *Database) SaveIpInbound(ip, rule string) bool
- func (d *Database) SaveSubIdIndex(devId, subId string, amount int64) bool
- func (d *Database) UpdateBalance(login string, amount int64, gasFee int64, coin string) (int, error)
- func (d *Database) UpdateIdInboundAlarm(id, alarm string) bool
- func (d *Database) UpdateIdInboundDesc(id, desc string) bool
- func (d *Database) UpdatePayoutLimit(login string, dgcValue string) bool
- func (d *Database) WriteBlock(login, id string, params []string, diff, roundDiff int64, height uint64, ...)
- func (d *Database) WriteCandidates(height uint64, params []string, nowTime string, ts int64, roundDiff int64, ...)
- func (d *Database) WriteImmatureBlock(block *types.BlockData, roundRewards map[string]int64, ...) error
- func (d *Database) WriteImmatureError(block *types.BlockData, blockState int, errNum int) error
- func (d *Database) WriteMaturedBlock(block *types.BlockData, roundRewards map[string]int64, ...) error
- func (d *Database) WriteMinerCharts(time1 int64, time2, k string, hash, largeHash, workerOnline int64, share int64, ...) error
- func (d *Database) WriteOrphan(block *types.BlockData) error
- func (d *Database) WritePayment(login, txHash string, amount int64, gasFee int64, coin string, from string) error
- func (d *Database) WritePendingOrphans(blocks []*types.BlockData) error
- func (d *Database) WriteShare(login, id string, params []string, diff int64, height uint64, ...) error
- type ImmaturedState
- type LogEntrie
- type MinerChartSelect
- type Payees
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Endpoint string `json:"endpoint"` UserName string `json:"user"` Password string `json:"password"` Database string `json:"database"` Port int `json:"port"` PoolSize int `json:"poolSize"` Coin string `json:"coin"` Threshold int64 `json:"threshold"` LogTableName string `json:"logTableName"` }
type Database ¶
type Database struct { Conn *sql.DB Redis *redis.RedisClient Config *Config }
func (*Database) ChangeAccountAccess ¶
func (*Database) ChangeAccountPassword ¶
func (*Database) CheckTimeMinerCharts ¶
func (d *Database) CheckTimeMinerCharts(miner *MinerChartSelect, ts int64, minerChartIntvSec int64) bool
func (*Database) CollectLuckStats ¶
func (*Database) CollectStats ¶
func (*Database) CreateAccount ¶
func (*Database) DelIdInbound ¶
func (*Database) DelIpInbound ¶
func (*Database) DelSubIdIndex ¶
func (*Database) DeleteAccount ¶
func (*Database) DeleteBlockBalance ¶
func (*Database) GetAccountPassword ¶
func (*Database) GetAlarmInfo ¶
func (d *Database) GetAlarmInfo() (map[string]*types.InboundIdList, error)
func (*Database) GetAllMinerAccount ¶
func (*Database) GetAllPayments ¶
func (*Database) GetBlockBalanceMinMax ¶
func (*Database) GetCandidates ¶
func (*Database) GetChartRewardList ¶
func (*Database) GetIdInboundList ¶
func (d *Database) GetIdInboundList() ([]*types.InboundIdList, error)
func (*Database) GetImmatureBlocks ¶
func (*Database) GetIpInboundList ¶
func (d *Database) GetIpInboundList() ([]*types.InboundIpList, error)
func (*Database) GetLikeMinerSubList ¶
func (d *Database) GetLikeMinerSubList(addr string) ([]*types.DevSubList, error)
func (*Database) GetMinerCharts ¶
func (*Database) GetMinerStats ¶
func (*Database) GetMinerSubInfo ¶
func (d *Database) GetMinerSubInfo(devId string) ([]*types.DevSubList, error)
func (*Database) GetMinerSubList ¶
func (d *Database) GetMinerSubList() ([]*types.DevSubList, error)
func (*Database) GetPoolBalanceByOnce ¶
func (*Database) InsertSqlLog ¶
func (*Database) IsIdInboundId ¶
func (*Database) IsMinerExists ¶
func (*Database) SaveIdInbound ¶
func (*Database) SaveIpInbound ¶
func (*Database) SaveSubIdIndex ¶
func (*Database) UpdateBalance ¶
func (d *Database) UpdateBalance(login string, amount int64, gasFee int64, coin string) (int, error)
UpdateBalance Confirm the reward coin with the miner's wallet address.
func (*Database) UpdateIdInboundAlarm ¶
func (*Database) UpdateIdInboundDesc ¶
func (*Database) UpdatePayoutLimit ¶
func (*Database) WriteBlock ¶
func (*Database) WriteCandidates ¶
func (*Database) WriteImmatureBlock ¶
func (*Database) WriteImmatureError ¶
func (*Database) WriteMaturedBlock ¶
func (d *Database) WriteMaturedBlock(block *types.BlockData, roundRewards map[string]int64, percents map[string]*big.Rat) error
WriteMaturedBlock If the reward miner is more than 20,000, you need to increase the query capacity or modify it!!
func (*Database) WriteMinerCharts ¶
func (*Database) WritePayment ¶
func (*Database) WritePendingOrphans ¶
type ImmaturedState ¶
type ImmaturedState string
type MinerChartSelect ¶
Click to show internal directories.
Click to hide internal directories.