Documentation ¶
Index ¶
- Constants
- Variables
- func AddAppVersion(ctx context.Context, appVer *model.AppVersion) error
- func AddApplication(ctx context.Context, application *model.Application) error
- func AddApplicationResult(ctx context.Context, result []*model.ApplicationResult) error
- func AddAssets(ctx context.Context, assets []*model.Asset) error
- func AddFilStorages(ctx context.Context, storages []*model.FilStorage) error
- func AddLoginLog(ctx context.Context, log *model.LoginLog) error
- func AddOperationLog(ctx context.Context, log *model.OperationLog) error
- func AddSignature(ctx context.Context, signature *model.Signature) error
- func AddStorageProvider(ctx context.Context, sp *model.StorageProvider) error
- func AddStorageStats(ctx context.Context, stats []*model.StorageStats) error
- func AddSubscription(ctx context.Context, subscription *model.Subscription) error
- func AddUserSecret(ctx context.Context, userSecret *model.UserSecret) error
- func AddWithdrawRequest(ctx context.Context, withdraw *model.Withdraw) error
- func BulkAddDeviceInfo(ctx context.Context, deviceInfos []*model.DeviceInfo) error
- func BulkInsertOrUpdateDeviceStatus(ctx context.Context, deviceInfos []*model.DeviceInfo) error
- func BulkUpdateDeviceInfo(ctx context.Context, deviceInfos []*model.DeviceInfo) error
- func BulkUpdateUserReward(ctx context.Context, users []*model.User) error
- func BulkUpsertDeviceInfo(ctx context.Context, deviceInfos []*model.DeviceInfo) error
- func BulkUpsertDeviceInfoDaily(ctx context.Context, dailyInfos []*model.DeviceInfoDaily) error
- func BulkUpsertDeviceInfoHours(ctx context.Context, hourInfos []*model.DeviceInfoHour) error
- func BulkUpsertStorageHours(ctx context.Context, userInfos []*model.UserInfo) error
- func CacheFullNodeInfo(ctx context.Context, fullNodeInfo *model.FullNodeInfo) error
- func CacheMapInfo(ctx context.Context, mapInfo []*MapInfo, lang model.Language) error
- func ContactIPLocation(loc model.Location, lang model.Language) string
- func CountAssets(ctx context.Context) ([]*model.StorageStats, error)
- func CountFilStorage(ctx context.Context, cid string) (int64, error)
- func CountRetrievalEvent(ctx context.Context, nodeId string) error
- func CountStorageStats(ctx context.Context) (*model.StorageSummary, error)
- func CountUploadTraffic(ctx context.Context, nodeId string) error
- func CreateLink(ctx context.Context, link *model.Link) error
- func CreateRetrievalEvents(ctx context.Context, events []*model.RetrievalEvent) error
- func CreateUser(ctx context.Context, user *model.User) error
- func DeleteDeviceInfoHourHistory(ctx context.Context, before time.Time) error
- func GetAllDeviceUserIdFromCache(ctx context.Context, areaId string) (map[string]string, error)
- func GetAllSignInfo() ([]model.SignInfo, error)
- func GetAppVersion(ctx context.Context, version string, platform string, lang model.Language) (*model.AppVersion, error)
- func GetApplicationAmount(ctx context.Context, option QueryOption) (int64, error)
- func GetApplicationList(ctx context.Context, status []int) ([]*model.Application, error)
- func GetApplicationResults(ctx context.Context, applicationID int64) ([]*model.ApplicationResult, error)
- func GetApplicationsByPage(ctx context.Context, option QueryOption) ([]*model.Application, int64, error)
- func GetAreaCount(ctx context.Context, deviceIds []string) (int64, error)
- func GetAssetByCID(ctx context.Context, cid string) (*model.Asset, error)
- func GetAssetList(ctx context.Context, deviceIds []string, lang model.Language, ...) ([]*model.DeviceInfo, error)
- func GetAssetsByEmptyPath(ctx context.Context) ([]*model.Asset, int64, error)
- func GetCacheFullNodeInfo(ctx context.Context) (*model.FullNodeInfo, error)
- func GetDeviceDistribution(ctx context.Context, lang model.Language) ([]*model.DeviceDistribution, error)
- func GetDeviceInfo(ctx context.Context, deviceId string) (*model.DeviceInfo, error)
- func GetDeviceInfoByDeviceId(ctx context.Context, cond *model.DeviceInfoDaily, option QueryOption) ([]*model.DeviceInfoDaily, int64, error)
- func GetDeviceInfoByID(ctx context.Context, deviceID string) (*model.DeviceInfo, error)
- func GetDeviceInfoById(ctx context.Context, deviceId string) model.DeviceInfo
- func GetDeviceInfoDailyByPage(ctx context.Context, cond *model.DeviceInfoDaily, option QueryOption) ([]*model.DeviceInfoDaily, int64, error)
- func GetDeviceInfoList(ctx context.Context, cond *model.DeviceInfo, option QueryOption) ([]*model.DeviceInfo, int64, error)
- func GetDeviceInfoListByKey(ctx context.Context, cond *model.DeviceInfo, option QueryOption) ([]*model.DeviceInfo, int64, error)
- func GetDeviceProfileFromCache(ctx context.Context, deviceId string) (map[string]string, error)
- func GetDeviceUserIdFromCache(ctx context.Context, deviceId, areaId string) (string, error)
- func GetFullNodeInfoList(ctx context.Context, cond *model.FullNodeInfo, option QueryOption) ([]*model.FullNodeInfo, int64, error)
- func GetIdIfExist(ctx context.Context, nodeId string) bool
- func GetInfoByMinerID(minerID string) (model.SignInfo, error)
- func GetLastStorageStats(ctx context.Context) (*model.StorageStats, error)
- func GetLatestAppVersion(ctx context.Context, platform string, lang model.Language) (model.AppVersion, error)
- func GetLatestAsset(ctx context.Context) (*model.Asset, error)
- func GetLocationInfoByIp(ctx context.Context, ip string, out *model.Location, lang model.Language) error
- func GetLoginLocation(ctx context.Context, userId string) string
- func GetLongLink(ctx context.Context, cid string) string
- func GetNodesInfo(ctx context.Context, option QueryOption) (int64, []model.NodesInfo, error)
- func GetOnlineIPCountsFromCache(ctx context.Context, ip string) (int64, error)
- func GetPeakBandwidth(ctx context.Context, userId string) (int64, error)
- func GetQueryDataList(sqlClause string, args ...interface{}) ([]map[string]string, error)
- func GetReferralList(ctx context.Context, username string, option QueryOption) (int64, []*model.InviteFrensRecord, error)
- func GetRetrievalEventsFromDeviceByPage(ctx context.Context, cond *model.DeviceInfoHour, option QueryOption) ([]*model.DeviceInfoHour, int64, error)
- func GetRewardStatementByDeviceID(ctx context.Context, deviceId string) (*model.RewardStatement, error)
- func GetSecretKey(ctx context.Context, key string) (*model.UserSecret, error)
- func GetShortLink(ctx context.Context, link string) string
- func GetSignatureByHash(ctx context.Context, hash string) (*model.Signature, error)
- func GetSignatureByNodeId(ctx context.Context, nodeId string) (*model.Signature, error)
- func GetStorageProvider(ctx context.Context, providerID string) (*model.StorageProvider, error)
- func GetSumUserDeviceReward(ctx context.Context) ([]*model.User, error)
- func GetUnfinishedEvent(ctx context.Context) ([]string, error)
- func GetUserByRefCode(ctx context.Context, refCode string) (*model.User, error)
- func GetUserByUsername(ctx context.Context, username string) (*model.User, error)
- func GetUserIds(ctx context.Context) ([]string, error)
- func GetUserIncome(cond *model.DeviceInfo, option QueryOption) (map[string]map[string]interface{}, error)
- func GetUsersReferrer(ctx context.Context, username string) (*model.User, error)
- func GetWithdrawRecordList(ctx context.Context, username string, option QueryOption) (int64, []*model.Withdraw, error)
- func HandleMapInfo(infos []*model.DeviceInfo, lang model.Language) []map[string]interface{}
- func Init(cfg *config.Config) error
- func ListFilStorages(ctx context.Context, path string, option QueryOption) ([]*model.FilStorage, int64, error)
- func ListLoginLog(ctx context.Context, option QueryOption) ([]*model.LoginLog, int64, error)
- func ListOperationLog(ctx context.Context, option QueryOption) ([]*model.OperationLog, int64, error)
- func ListStorageStats(ctx context.Context, projectId int64, opts QueryOption) ([]*model.StorageStats, int64, error)
- func OnlineIPCounts(ctx context.Context) (map[string]interface{}, error)
- func QueryMaxDeviceDailyInfo(ctx context.Context, deviceIds []string, start, end string) (map[string]*model.DeviceInfoDaily, error)
- func ReplaceSignInfo(info *model.SignInfo) error
- func ResetPassword(ctx context.Context, passHash, username string) error
- func SetDeviceProfileFromCache(ctx context.Context, deviceId string, data map[string]string) error
- func SetDeviceUserIdToCache(ctx context.Context, deviceId, userId, areaId string) error
- func SetMultipleDeviceUserIdToCache(ctx context.Context, areaId string, keyVal map[string]string) error
- func SetOnlineIPCountsToCache(ctx context.Context, data map[string]interface{}) error
- func SumDeviceDailyBeforeDate(ctx context.Context, deviceIds []string, end string) (map[string]*model.DeviceInfoDaily, error)
- func SumFilStorage(ctx context.Context) (int64, error)
- func SumFullNodeInfoFromDeviceInfo(ctx context.Context) (*model.FullNodeInfo, error)
- func SumSystemInfo(ctx context.Context) (*model.SystemInfo, error)
- func SumUserDeviceReward(ctx context.Context) (map[string]int64, error)
- func SumUserReferralReward(ctx context.Context) ([]*model.User, error)
- func SumUserReferralReward2(ctx context.Context) (map[string]float64, error)
- func SumUserReferralReward3(ctx context.Context) (map[string]float64, error)
- func TranslateIPLocation(ctx context.Context, info *model.DeviceInfo, lang model.Language)
- func UpdateAppVersion(ctx context.Context, appVer *model.AppVersion) error
- func UpdateApplicationStatus(ctx context.Context, id int64, status int) error
- func UpdateAssetEvent(ctx context.Context, cid string, event int) error
- func UpdateAssetPath(ctx context.Context, cid string, path string) error
- func UpdateDeviceInfoDailyUser(ctx context.Context, deviceId, userId string) error
- func UpdateDeviceName(ctx context.Context, deviceInfo *model.DeviceInfo) error
- func UpdateDownloadCount(ctx context.Context, deviceInfo *model.DeviceInfo) error
- func UpdateSignature(ctx context.Context, signature, nodeId, areaId, hash string) error
- func UpdateTotalDownload(ctx context.Context, deviceInfo *model.DeviceInfo) error
- func UpdateUserDeviceInfo(ctx context.Context, deviceInfo *model.DeviceInfo) error
- func UpdateUserWalletAddress(ctx context.Context, username, address string) error
- func UpsertFullNodeInfo(ctx context.Context, fullNodeInfo *model.FullNodeInfo) error
- func UpsertLocationInfo(ctx context.Context, out *model.Location, lang model.Language) error
- func UpsertSystemInfo(ctx context.Context, systemInfo *model.SystemInfo) error
- type ActiveInfoOut
- type CacheStatistics
- func GetCacheInfoDaysList(ctx context.Context, where string, option QueryOption) ([]*CacheStatistics, error)
- func GetCacheInfoHourList(ctx context.Context, where string, option QueryOption) ([]*CacheStatistics, error)
- func QueryCacheDaily(deviceID, startTime, endTime string) []*CacheStatistics
- func QueryCacheHour(deviceID, startTime, endTime string) []*CacheStatistics
- type DeviceStatistics
- func GetDeviceHourlyIncome(ctx context.Context, nodeId string, option QueryOption) ([]*DeviceStatistics, error)
- func GetDeviceInfoDailyList(ctx context.Context, cond *model.DeviceInfoDaily, option QueryOption) ([]*DeviceStatistics, error)
- func GetDeviceInfoDailyListAppendDays(ctx context.Context, cond *model.DeviceInfoDaily, option QueryOption) ([]*DeviceStatistics, error)
- func GetDeviceInfoHourList(ctx context.Context, cond *model.DeviceInfoHour, option QueryOption) ([]*DeviceStatistics, error)
- func GetLatestDeviceStat(ctx context.Context, deviceId string, start string) (DeviceStatistics, error)
- func GetNodesInfoDailyList(ctx context.Context, cond *model.DeviceInfoDaily, option QueryOption) ([]*DeviceStatistics, error)
- type FullNodeDaysInfo
- type MapInfo
- type QueryOption
- type UserDeviceProfile
- type UserInfoRes
Constants ¶
View Source
const ( ApplicationStatusCreated = iota + 1 ApplicationStatusFailed ApplicationStatusSendEmailFailed ApplicationStatusFinished )
View Source
const ( FullNodeInfoKeyExpiration = 0 FullNodeInfoKey = "TITAN::FULL_NODE_INFO" )
Variables ¶
View Source
var ( // DB reference to database DB *sqlx.DB // RedisCache redis caching instance RedisCache *redis.Client )
View Source
var ErrNoRow = fmt.Errorf("no matching row found")
Functions ¶
func AddAppVersion ¶
func AddAppVersion(ctx context.Context, appVer *model.AppVersion) error
func AddApplication ¶
func AddApplication(ctx context.Context, application *model.Application) error
func AddApplicationResult ¶
func AddApplicationResult(ctx context.Context, result []*model.ApplicationResult) error
func AddFilStorages ¶
func AddFilStorages(ctx context.Context, storages []*model.FilStorage) error
func AddOperationLog ¶
func AddOperationLog(ctx context.Context, log *model.OperationLog) error
func AddStorageProvider ¶
func AddStorageProvider(ctx context.Context, sp *model.StorageProvider) error
func AddStorageStats ¶
func AddStorageStats(ctx context.Context, stats []*model.StorageStats) error
func AddSubscription ¶
func AddSubscription(ctx context.Context, subscription *model.Subscription) error
func AddUserSecret ¶
func AddUserSecret(ctx context.Context, userSecret *model.UserSecret) error
func AddWithdrawRequest ¶
func BulkAddDeviceInfo ¶
func BulkAddDeviceInfo(ctx context.Context, deviceInfos []*model.DeviceInfo) error
func BulkInsertOrUpdateDeviceStatus ¶
func BulkInsertOrUpdateDeviceStatus(ctx context.Context, deviceInfos []*model.DeviceInfo) error
func BulkUpdateDeviceInfo ¶
func BulkUpdateDeviceInfo(ctx context.Context, deviceInfos []*model.DeviceInfo) error
func BulkUpdateUserReward ¶
func BulkUpsertDeviceInfo ¶
func BulkUpsertDeviceInfo(ctx context.Context, deviceInfos []*model.DeviceInfo) error
func BulkUpsertDeviceInfoDaily ¶
func BulkUpsertDeviceInfoDaily(ctx context.Context, dailyInfos []*model.DeviceInfoDaily) error
func BulkUpsertDeviceInfoHours ¶
func BulkUpsertDeviceInfoHours(ctx context.Context, hourInfos []*model.DeviceInfoHour) error
func BulkUpsertStorageHours ¶
func CacheFullNodeInfo ¶
func CacheFullNodeInfo(ctx context.Context, fullNodeInfo *model.FullNodeInfo) error
func CacheMapInfo ¶
func CountAssets ¶
func CountAssets(ctx context.Context) ([]*model.StorageStats, error)
func CountStorageStats ¶
func CountStorageStats(ctx context.Context) (*model.StorageSummary, error)
func CreateRetrievalEvents ¶
func CreateRetrievalEvents(ctx context.Context, events []*model.RetrievalEvent) error
func GetAllSignInfo ¶
func GetAppVersion ¶
func GetApplicationAmount ¶
func GetApplicationAmount(ctx context.Context, option QueryOption) (int64, error)
func GetApplicationList ¶
func GetApplicationResults ¶
func GetApplicationsByPage ¶
func GetApplicationsByPage(ctx context.Context, option QueryOption) ([]*model.Application, int64, error)
func GetAssetList ¶
func GetAssetList(ctx context.Context, deviceIds []string, lang model.Language, option QueryOption) ([]*model.DeviceInfo, error)
func GetAssetsByEmptyPath ¶
func GetCacheFullNodeInfo ¶
func GetCacheFullNodeInfo(ctx context.Context) (*model.FullNodeInfo, error)
func GetDeviceDistribution ¶
func GetDeviceInfo ¶
func GetDeviceInfoByDeviceId ¶
func GetDeviceInfoByDeviceId(ctx context.Context, cond *model.DeviceInfoDaily, option QueryOption) ([]*model.DeviceInfoDaily, int64, error)
func GetDeviceInfoByID ¶
func GetDeviceInfoById ¶
func GetDeviceInfoById(ctx context.Context, deviceId string) model.DeviceInfo
func GetDeviceInfoDailyByPage ¶
func GetDeviceInfoDailyByPage(ctx context.Context, cond *model.DeviceInfoDaily, option QueryOption) ([]*model.DeviceInfoDaily, int64, error)
func GetDeviceInfoList ¶
func GetDeviceInfoList(ctx context.Context, cond *model.DeviceInfo, option QueryOption) ([]*model.DeviceInfo, int64, error)
func GetDeviceInfoListByKey ¶
func GetDeviceInfoListByKey(ctx context.Context, cond *model.DeviceInfo, option QueryOption) ([]*model.DeviceInfo, int64, error)
func GetFullNodeInfoList ¶
func GetFullNodeInfoList(ctx context.Context, cond *model.FullNodeInfo, option QueryOption) ([]*model.FullNodeInfo, int64, error)
func GetLastStorageStats ¶
func GetLastStorageStats(ctx context.Context) (*model.StorageStats, error)
func GetLatestAppVersion ¶
func GetLocationInfoByIp ¶
func GetNodesInfo ¶
func GetQueryDataList ¶
func GetReferralList ¶
func GetReferralList(ctx context.Context, username string, option QueryOption) (int64, []*model.InviteFrensRecord, error)
func GetRetrievalEventsFromDeviceByPage ¶
func GetRetrievalEventsFromDeviceByPage(ctx context.Context, cond *model.DeviceInfoHour, option QueryOption) ([]*model.DeviceInfoHour, int64, error)
func GetSecretKey ¶
func GetSignatureByHash ¶
func GetSignatureByNodeId ¶
func GetStorageProvider ¶
func GetSumUserDeviceReward ¶
func GetUserByRefCode ¶
func GetUserByUsername ¶
func GetUserIncome ¶
func GetUserIncome(cond *model.DeviceInfo, option QueryOption) (map[string]map[string]interface{}, error)
func GetUsersReferrer ¶
func GetWithdrawRecordList ¶
func HandleMapInfo ¶
func HandleMapInfo(infos []*model.DeviceInfo, lang model.Language) []map[string]interface{}
func ListFilStorages ¶
func ListFilStorages(ctx context.Context, path string, option QueryOption) ([]*model.FilStorage, int64, error)
func ListLoginLog ¶
func ListOperationLog ¶
func ListOperationLog(ctx context.Context, option QueryOption) ([]*model.OperationLog, int64, error)
func ListStorageStats ¶
func ListStorageStats(ctx context.Context, projectId int64, opts QueryOption) ([]*model.StorageStats, int64, error)
func QueryMaxDeviceDailyInfo ¶
func ReplaceSignInfo ¶
func SetDeviceUserIdToCache ¶
func SumFullNodeInfoFromDeviceInfo ¶
func SumFullNodeInfoFromDeviceInfo(ctx context.Context) (*model.FullNodeInfo, error)
func SumSystemInfo ¶
func SumSystemInfo(ctx context.Context) (*model.SystemInfo, error)
func SumUserReferralReward2 ¶
func SumUserReferralReward3 ¶
func TranslateIPLocation ¶
func UpdateAppVersion ¶
func UpdateAppVersion(ctx context.Context, appVer *model.AppVersion) error
func UpdateApplicationStatus ¶
func UpdateDeviceName ¶
func UpdateDeviceName(ctx context.Context, deviceInfo *model.DeviceInfo) error
func UpdateDownloadCount ¶
func UpdateDownloadCount(ctx context.Context, deviceInfo *model.DeviceInfo) error
func UpdateSignature ¶
func UpdateTotalDownload ¶
func UpdateTotalDownload(ctx context.Context, deviceInfo *model.DeviceInfo) error
func UpdateUserDeviceInfo ¶
func UpdateUserDeviceInfo(ctx context.Context, deviceInfo *model.DeviceInfo) error
func UpdateUserWalletAddress ¶
func UpsertFullNodeInfo ¶
func UpsertFullNodeInfo(ctx context.Context, fullNodeInfo *model.FullNodeInfo) error
func UpsertLocationInfo ¶
func UpsertSystemInfo ¶
func UpsertSystemInfo(ctx context.Context, systemInfo *model.SystemInfo) error
Types ¶
type ActiveInfoOut ¶
type ActiveInfoOut struct { DeviceId string `db:"device_id" json:"device_id"` ActiveStatus string `db:"active_status" json:"active_status"` Secret string `db:"secret" json:"secret"` }
func GetDeviceActiveInfoList ¶
func GetDeviceActiveInfoList(ctx context.Context, cond *model.DeviceInfo, option QueryOption) ([]*ActiveInfoOut, int64, error)
type CacheStatistics ¶
type CacheStatistics struct { Date string `json:"date" db:"date"` BlockCount float64 `json:"block_count" db:"block_count"` }
func GetCacheInfoDaysList ¶
func GetCacheInfoDaysList(ctx context.Context, where string, option QueryOption) ([]*CacheStatistics, error)
func GetCacheInfoHourList ¶
func GetCacheInfoHourList(ctx context.Context, where string, option QueryOption) ([]*CacheStatistics, error)
func QueryCacheDaily ¶
func QueryCacheDaily(deviceID, startTime, endTime string) []*CacheStatistics
func QueryCacheHour ¶
func QueryCacheHour(deviceID, startTime, endTime string) []*CacheStatistics
type DeviceStatistics ¶
type DeviceStatistics struct { Date string `json:"date" db:"date"` NatRatio float64 `json:"nat_ratio" db:"nat_ratio"` DiskUsage float64 `json:"disk_usage" db:"disk_usage"` DiskSpace float64 `json:"disk_space" db:"disk_space"` Latency float64 `json:"latency" db:"latency"` PkgLossRatio float64 `json:"pkg_loss_ratio" db:"pkg_loss_ratio"` Income float64 `json:"income" db:"income"` OnlineTime float64 `json:"online_time" db:"online_time"` BandwidthUp float64 `db:"bandwidth_up" json:"bandwidth_up"` BandwidthDown float64 `db:"bandwidth_down" json:"bandwidth_down"` UpstreamTraffic float64 `json:"upstream_traffic" db:"upstream_traffic"` DownstreamTraffic float64 `json:"downstream_traffic" db:"downstream_traffic"` RetrievalCount float64 `json:"retrieval_count" db:"retrieval_count"` BlockCount float64 `json:"block_count" db:"block_count"` NodeCount float64 `json:"node_count" db:"node_count"` }
func GetDeviceHourlyIncome ¶
func GetDeviceHourlyIncome(ctx context.Context, nodeId string, option QueryOption) ([]*DeviceStatistics, error)
func GetDeviceInfoDailyList ¶
func GetDeviceInfoDailyList(ctx context.Context, cond *model.DeviceInfoDaily, option QueryOption) ([]*DeviceStatistics, error)
func GetDeviceInfoDailyListAppendDays ¶
func GetDeviceInfoDailyListAppendDays(ctx context.Context, cond *model.DeviceInfoDaily, option QueryOption) ([]*DeviceStatistics, error)
func GetDeviceInfoHourList ¶
func GetDeviceInfoHourList(ctx context.Context, cond *model.DeviceInfoHour, option QueryOption) ([]*DeviceStatistics, error)
func GetLatestDeviceStat ¶
func GetNodesInfoDailyList ¶
func GetNodesInfoDailyList(ctx context.Context, cond *model.DeviceInfoDaily, option QueryOption) ([]*DeviceStatistics, error)
type FullNodeDaysInfo ¶
type FullNodeDaysInfo struct { Date string `json:"date" db:"date"` TotalNodeCount int64 `db:"total_node_count" json:"total_node_count"` OnlineNodeCount int64 `db:"online_node_count" json:"online_node_count"` SPNodeCount int64 `db:"sp_node_count" json:"sp_node_count"` L1NodeCount int64 `db:"l1_count" json:"l1_count"` OnlineL1NodeCount int64 `db:"online_l1_count" json:"online_l1_count"` L2NodeCount int64 `db:"l2_count" json:"l2_count"` OnlineL2NodeCount int64 `db:"online_l2_count" json:"online_l2_count"` TUpstreamFileCount int64 `db:"t_upstream_file_count" json:"t_upstream_file_count"` TotalStorage float64 `db:"total_storage" json:"total_storage"` StorageUsed float64 `db:"storage_used" json:"storage_used"` TotalUpstreamBandwidth float64 `db:"total_upstream_bandwidth" json:"total_upstream_bandwidth"` TotalDownstreamBandwidth float64 `db:"total_downstream_bandwidth" json:"total_downstream_bandwidth"` }
func GetNodesDaysList ¶
func GetNodesDaysList(ctx context.Context, option QueryOption) ([]*FullNodeDaysInfo, error)
func QueryNodesDailyInfo ¶
func QueryNodesDailyInfo(startTime, endTime string) []*FullNodeDaysInfo
type MapInfo ¶
type MapInfo struct { Name string `json:"name"` NodeType string `json:"nodeType"` Ip string `json:"ip"` Value []float64 `json:"value"` }
func GetDeviceMapInfo ¶
type QueryOption ¶
type QueryOption struct { Page int `json:"page"` PageSize int `json:"page_size"` Order string `json:"order"` OrderField string `json:"order_field"` StartTime string `json:"start_time"` EndTime string `json:"end_time" ` UserID string `json:"user_id"` NotBound string `json:"not_bound"` Lang model.Language `json:"-"` }
func OptionHandle ¶
func OptionHandle(startTime, endTime string) QueryOption
type UserDeviceProfile ¶
type UserDeviceProfile struct { CumulativeProfit float64 `json:"cumulative_profit" db:"cumulative_profit"` YesterdayProfit float64 `json:"yesterday_profit" db:"yesterday_profit"` TodayProfit float64 `json:"today_profit" db:"today_profit"` SevenDaysProfit float64 `json:"seven_days_profit" db:"seven_days_profit"` MonthProfit float64 `json:"month_profit" db:"month_profit"` NodeType *int `json:"node_type" db:"node_type"` TotalNum int64 `json:"total_num" db:"total_num"` OnlineNum int64 `json:"online_num" db:"online_num"` OfflineNum int64 `json:"offline_num" db:"offline_num"` AbnormalNum int64 `json:"abnormal_num" db:"abnormal_num"` TotalBandwidth float64 `json:"total_bandwidth" db:"total_bandwidth"` }
func CountUserDeviceInfo ¶
func CountUserDeviceInfo(ctx context.Context, userID string) (*UserDeviceProfile, error)
type UserInfoRes ¶
type UserInfoRes struct { Date string `json:"date" db:"date"` TotalBandwidth int64 `db:"total_bandwidth"` PeakBandwidth int64 `db:"peak_bandwidth"` DownloadCount int64 `db:"download_count"` }
func GetStorageInfoDaysList ¶
func GetStorageInfoDaysList(ctx context.Context, userId string, option QueryOption) ([]*UserInfoRes, error)
func GetStorageInfoHourList ¶
func GetStorageInfoHourList(ctx context.Context, userId string, option QueryOption) ([]*UserInfoRes, error)
Source Files ¶
- app_version.go
- application.go
- assets.go
- base.go
- cache_event.go
- devices_info.go
- fil_storage.go
- full_node_info.go
- location.go
- login_log.go
- operation_log.go
- retrieval_event.go
- reward_statement.go
- rewards.go
- sign_info.go
- signature.go
- storage.go
- storage_stats.go
- subscription.go
- system_info.go
- user_secret.go
- users.go
Click to show internal directories.
Click to hide internal directories.