Documentation
¶
Index ¶
- Variables
- type DailyAsset
- type DoubleColorBallBetting
- type LottoUseCase
- type MarketDbRepo
- type Recharge
- type TickerPrice
- type TickerPriceDaily
- type TradesUseCase
- func (tradesUseCase *TradesUseCase) AvgPrice(ctx context.Context, symbol string)
- func (tradesUseCase *TradesUseCase) DayTicker(ctx context.Context, symbol string)
- func (tradesUseCase *TradesUseCase) GoodTicker(ctx context.Context)
- func (tradesUseCase *TradesUseCase) LastTicker(ctx context.Context)
- func (tradesUseCase *TradesUseCase) ListSymbolPrice(ctx context.Context, symbol string, startTime int64, endTime int64) ([]TickerPrice, error)
- func (tradesUseCase *TradesUseCase) ListSymbols(ctx context.Context) []string
- func (tradesUseCase *TradesUseCase) TickerPrice(ctx context.Context, symbol string, windowsSize int64)
- func (tradesUseCase *TradesUseCase) Trades(ctx context.Context)
- func (tradesUseCase *TradesUseCase) TradesHis(ctx context.Context)
- type Transport
- type WalletDbRepo
- type WalletUseCase
- func (walletUseCase *WalletUseCase) AccountStatus(ctx context.Context)
- func (walletUseCase *WalletUseCase) GetFundingAsset(ctx context.Context)
- func (walletUseCase *WalletUseCase) GetPerDayAssets(ctx context.Context)
- func (walletUseCase *WalletUseCase) GetPerDayAssetsByDB(ctx context.Context, asset string, startTime int64, endTime int64) ([]DailyAsset, error)
- func (walletUseCase *WalletUseCase) GetUserAsset(ctx context.Context)
- func (walletUseCase *WalletUseCase) RechargeHis(ctx context.Context)
- func (walletUseCase *WalletUseCase) SystemStatus()
- func (walletUseCase *WalletUseCase) ToBNBHis(ctx context.Context)
- func (walletUseCase *WalletUseCase) TransportHis(ctx context.Context)
Constants ¶
This section is empty.
Variables ¶
View Source
var ProviderSet = wire.NewSet(NewTradesUseCase, NewWalletUseCase, NewLottoUseCase)
Functions ¶
This section is empty.
Types ¶
type DailyAsset ¶
type DailyAsset struct { Asset string `json:"asset,omitempty"` Free float64 `json:"free,omitempty"` Locked float64 `json:"locked,omitempty"` Time int64 `json:"time,omitempty"` CreateTime int64 `json:"createTime,omitempty"` }
func (DailyAsset) TableName ¶
func (dailyAsset DailyAsset) TableName() string
type DoubleColorBallBetting ¶
type LottoUseCase ¶
type LottoUseCase struct { }
func NewLottoUseCase ¶
func NewLottoUseCase() *LottoUseCase
func (*LottoUseCase) GetDoubleColorBallCount ¶
func (lottoUseCase *LottoUseCase) GetDoubleColorBallCount(ctx context.Context, redBallCount int, blueBallCount int) DoubleColorBallBetting
type MarketDbRepo ¶
type MarketDbRepo interface { RecordTickerPrice(ctx context.Context, tickerPrice TickerPrice) error GetTickerPriceBySymbol(ctx context.Context, symbol string, startTime, endTime int64) ([]TickerPrice, error) RecordTickerPriceDaily(ctx context.Context, tickerPriceDaily TickerPriceDaily) error }
type Recharge ¶
type Recharge struct { Id string `json:"id,omitempty"` Amount float64 `json:"amount,omitempty"` Coin string `json:"coin,omitempty"` Network string `json:"network,omitempty"` Status int `json:"status,omitempty"` Address string `json:"address,omitempty"` AddressTag string `json:"addressTag,omitempty"` TxId string `json:"txId,omitempty"` InsertTime int64 `json:"insertTime,omitempty"` TransferType int `json:"transferType,omitempty"` ConfirmTimes string `json:"confirmTimes,omitempty"` UnlockConfirm int `json:"unlockConfirm,omitempty"` WalletType int `json:"walletType,omitempty"` }
type TickerPrice ¶
type TickerPrice struct { Symbol string `json:"symbol,omitempty"` // 代号 PriceChange float64 `json:"priceChange,omitempty"` // 价格变化 PriceChangePercent float64 `json:"priceChangePercent,omitempty"` // 价格变化百分比 WeightedAvgPrice float64 `json:"weightedAvgPrice,omitempty"` // 加权平均价格 OpenPrice float64 `json:"openPrice,omitempty"` // 开盘价, 开始价格 HighPrice float64 `json:"highPrice,omitempty"` // 高价 LowPrice float64 `json:"lowPrice,omitempty"` // 低价 LastPrice float64 `json:"lastPrice,omitempty"` // 最后价格 Volume float64 `json:"volume,omitempty"` // 成交量 (BTC/USDT: 多少个BTC被买入和卖出) QuoteVolume float64 `json:"quoteVolume,omitempty"` // 报价货币成交量 (多少个USDT的价值被交易) OpenTime int64 `json:"openTime,omitempty"` // ticker的开始时间 CloseTime int64 `json:"closeTime,omitempty"` // ticker的结束时间 FirstId int64 `json:"firstId,omitempty"` // 统计时间内的第一笔trade id LastId int64 `json:"lastId,omitempty"` // Count int64 `json:"count,omitempty"` // 统计时间内交易笔数 }
func (TickerPrice) TableName ¶
func (tickerPrice TickerPrice) TableName() string
type TickerPriceDaily ¶
type TickerPriceDaily struct { Symbol string `json:"symbol,omitempty"` // 代号 PriceChange float64 `json:"priceChange,omitempty"` // 价格变化 PriceChangePercent float64 `json:"priceChangePercent,omitempty"` // 价格变化百分比 WeightedAvgPrice float64 `json:"weightedAvgPrice,omitempty"` // 加权平均价格 PrevClosePrice float64 `json:"prevClosePrice,omitempty"` // BidPrice float64 `json:"bidPrice,omitempty"` // 出价价格 BidQty float64 `json:"bidQty,omitempty"` // 出价数量 AskPrice float64 `json:"askPrice,omitempty"` // 询价价格 AskQty float64 `json:"askQty,omitempty"` // 询价数量 OpenPrice float64 `json:"openPrice,omitempty"` // 开盘价, 开始价格 HighPrice float64 `json:"highPrice,omitempty"` // 高价 LowPrice float64 `json:"lowPrice,omitempty"` // 低价 LastPrice float64 `json:"lastPrice,omitempty"` // 最后价格 LastQty float64 `json:"lastQty,omitempty"` // 最后价格数量 Volume float64 `json:"volume,omitempty"` // 成交量 (BTC/USDT: 多少个BTC被买入和卖出) QuoteVolume float64 `json:"quoteVolume,omitempty"` // 报价货币成交量 (多少个USDT的价值被交易) OpenTime int64 `json:"openTime,omitempty"` // ticker的开始时间 CloseTime int64 `json:"closeTime,omitempty"` // ticker的结束时间 FirstId int64 `json:"firstId,omitempty"` // 统计时间内的第一笔trade id LastId int64 `json:"lastId,omitempty"` // Count int64 `json:"count,omitempty"` // 统计时间内交易笔数 }
func (TickerPriceDaily) TableName ¶
func (tickerPriceDaily TickerPriceDaily) TableName() string
type TradesUseCase ¶
type TradesUseCase struct { ApiKey string `json:"apiKey"` // contains filtered or unexported fields }
func NewTradesUseCase ¶
func NewTradesUseCase(binance *conf.Binance, marketDbRepo MarketDbRepo, logger log.Logger) *TradesUseCase
func (*TradesUseCase) AvgPrice ¶
func (tradesUseCase *TradesUseCase) AvgPrice(ctx context.Context, symbol string)
func (*TradesUseCase) DayTicker ¶
func (tradesUseCase *TradesUseCase) DayTicker(ctx context.Context, symbol string)
func (*TradesUseCase) GoodTicker ¶
func (tradesUseCase *TradesUseCase) GoodTicker(ctx context.Context)
func (*TradesUseCase) LastTicker ¶
func (tradesUseCase *TradesUseCase) LastTicker(ctx context.Context)
func (*TradesUseCase) ListSymbolPrice ¶
func (tradesUseCase *TradesUseCase) ListSymbolPrice(ctx context.Context, symbol string, startTime int64, endTime int64) ([]TickerPrice, error)
func (*TradesUseCase) ListSymbols ¶
func (tradesUseCase *TradesUseCase) ListSymbols(ctx context.Context) []string
func (*TradesUseCase) TickerPrice ¶
func (tradesUseCase *TradesUseCase) TickerPrice(ctx context.Context, symbol string, windowsSize int64)
func (*TradesUseCase) Trades ¶
func (tradesUseCase *TradesUseCase) Trades(ctx context.Context)
func (*TradesUseCase) TradesHis ¶
func (tradesUseCase *TradesUseCase) TradesHis(ctx context.Context)
type Transport ¶
type Transport struct { Id string `json:"id,omitempty"` Amount float64 `json:"amount,omitempty"` TransactionFee float64 `json:"transactionFee,omitempty"` Coin string `json:"coin,omitempty"` Status int `json:"status,omitempty"` Address string `json:"address,omitempty"` TxId string `json:"txId,omitempty"` ApplyTime string `json:"applyTime,omitempty"` Network string `json:"network,omitempty"` TransferType int `json:"transferType,omitempty"` WithdrawOrderId string `json:"withdrawOrderId,omitempty"` Info string `json:"info,omitempty"` ConfirmNo int `json:"confirmNo,omitempty"` WalletType int `json:"walletType,omitempty"` TxKey string `json:"txKey,omitempty"` CompleteTime string `json:"completeTime,omitempty" ` }
type WalletDbRepo ¶
type WalletDbRepo interface { RecordDailyAsset(ctx context.Context, asset DailyAsset) error GetDailyAssets(ctx context.Context, time int64) ([]DailyAsset, error) GetRangeDataByAsset(ctx context.Context, asset string, startTime, endTime int64) ([]DailyAsset, error) RecordRecharge(ctx context.Context, recharge Recharge) error GetRecharge(ctx context.Context, coin string, startTime, endTime int64) ([]Recharge, error) RecordTransport(ctx context.Context, transport Transport) error }
type WalletUseCase ¶
type WalletUseCase struct { ApiKey string SecretKey string // contains filtered or unexported fields }
func NewWalletUseCase ¶
func NewWalletUseCase(binance *conf.Binance, walletDbRepo WalletDbRepo, logger log.Logger) *WalletUseCase
func (*WalletUseCase) AccountStatus ¶
func (walletUseCase *WalletUseCase) AccountStatus(ctx context.Context)
func (*WalletUseCase) GetFundingAsset ¶
func (walletUseCase *WalletUseCase) GetFundingAsset(ctx context.Context)
func (*WalletUseCase) GetPerDayAssets ¶
func (walletUseCase *WalletUseCase) GetPerDayAssets(ctx context.Context)
func (*WalletUseCase) GetPerDayAssetsByDB ¶
func (walletUseCase *WalletUseCase) GetPerDayAssetsByDB(ctx context.Context, asset string, startTime int64, endTime int64) ([]DailyAsset, error)
func (*WalletUseCase) GetUserAsset ¶
func (walletUseCase *WalletUseCase) GetUserAsset(ctx context.Context)
func (*WalletUseCase) RechargeHis ¶
func (walletUseCase *WalletUseCase) RechargeHis(ctx context.Context)
func (*WalletUseCase) SystemStatus ¶
func (walletUseCase *WalletUseCase) SystemStatus()
func (*WalletUseCase) ToBNBHis ¶
func (walletUseCase *WalletUseCase) ToBNBHis(ctx context.Context)
func (*WalletUseCase) TransportHis ¶
func (walletUseCase *WalletUseCase) TransportHis(ctx context.Context)
Click to show internal directories.
Click to hide internal directories.