Documentation ¶
Index ¶
- Constants
- Variables
- func AcmeAdd(ctx context.Context, acme *model.Acme) error
- func AcmeRecord(ctx context.Context) (*model.Acme, error)
- func AcquireLock(rdb *redis.Client, lockKey string, lockValue string, expiration time.Duration) (bool, error)
- func AddAppVersion(ctx context.Context, appVer *model.AppVersion) error
- func AddAssetAndUpdateSize(ctx context.Context, asset *model.UserAsset, areaIDs []string, syncArea string) error
- func AddAssetGroupVisitCount(ctx context.Context, userID string, id int) error
- func AddAssetHourStorages(ctx context.Context, ahss []model.AssetStorageHour) error
- func AddAssets(ctx context.Context, assets []*model.Asset) error
- func AddDataCollection(ctx context.Context, dc *model.DataCollection) error
- func AddFilStorages(ctx context.Context, storages []*model.FilStorage) error
- func AddIPFSRecords(ctx context.Context, irs []model.SyncIPFSRecord) error
- func AddKOL(ctx context.Context, kol *model.KOL) error
- func AddKOLLevelConfig(ctx context.Context, levelConf *model.KOLLevelConfig) error
- func AddLoginLog(ctx context.Context, log *model.LoginLog) error
- func AddNewReferralCode(ctx context.Context, referralCode *model.ReferralCode) 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 AddSubscription(ctx context.Context, subscription *model.Subscription) error
- func AddTempAssetDownloadCount(ctx context.Context, hash string) error
- func AddTempAssetShareCount(ctx context.Context, hash string, size ...int64) error
- func AddUserAssetMap(ctx context.Context, userID, hash string) error
- func AddUserSecret(ctx context.Context, userSecret *model.UserSecret) error
- func AddVisitCount(ctx context.Context, hash string, user_id string) error
- func AdsAddCtx(ctx context.Context, ads *model.Ads) error
- func AdsDelCtx(ctx context.Context, id int64) error
- func AdsFindOne(ctx context.Context, id int64) (*model.Ads, error)
- func AdsListPageCtx(ctx context.Context, page, size int, sb squirrel.SelectBuilder) ([]*model.Ads, int64, error)
- func AdsUpdateCtx(ctx context.Context, ads *model.Ads) error
- func AllAssets(ctx context.Context) ([]*model.Asset, error)
- func AllUsers(ctx context.Context) ([]*model.User, error)
- func BugUpdateCtx(ctx context.Context, b *model.Bug) error
- func BugsAddCtx(ctx context.Context, b *model.Bug) error
- func BugsCountByBuilderCtx(ctx context.Context, cb squirrel.SelectBuilder) (int64, error)
- func BugsListPageCtx(ctx context.Context, page, size int, sb squirrel.SelectBuilder, sel string) ([]*model.Bug, int64, 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 BulkUpdateUserL1Reward(ctx context.Context, rewards []*model.UserL1Reward) error
- func BulkUpdateUserReferralReward(ctx context.Context, users []*model.User) error
- func BulkUpdateUserReward(ctx context.Context, users []*model.User) error
- func BulkUpdateUserRewardDetails(ctx context.Context, logs []*model.UserRewardDetail) 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 CacheIPLocation(ctx context.Context, location *model.Location, lang model.Language) error
- func CacheMapInfo(ctx context.Context, mapInfo []*MapInfo, lang model.Language) error
- func CheckAssetByMd5AndAreaExists(ctx context.Context, md5, areaID string) (string, bool, error)
- func CheckAssetHashIsExist(ctx context.Context, hash string) bool
- func CheckAssetIsSyncByAreaID(ctx context.Context, hash, areaID string) bool
- func CheckIsNodeOwner(ctx context.Context, uid, nodeID string) (int64, error)
- func CheckUserAseetNeedDel(ctx context.Context, hash, uid string, areaID []string) ([]string, bool, error)
- func CheckUserAssetIsInAreaID(ctx context.Context, userID, hash, areaID string) (bool, error)
- func CheckUserAssetIsOnly(ctx context.Context, hash, areaID string) (bool, error)
- func ContactIPLocation(loc model.Location, lang model.Language) string
- func CountAssets(ctx context.Context) (int64, error)
- func CountFilStorage(ctx context.Context, cid string) (int64, error)
- func CountPageViewByEvent(ctx context.Context, event model.DataCollectionEvent, code string, ...) (ipCount, pvCount int64, err error)
- func CountReferralUsersByCode(ctx context.Context, code string, option QueryOption) (referralUsers, referralNodes int64, err error)
- func CreateLink(ctx context.Context, link *model.Link) error
- func CreateUser(ctx context.Context, user *model.User) error
- func DelAssetAndUpdateSize(ctx context.Context, hash, userID string, areaID []string, isNeedDel bool) error
- func DeleteAssetGroup(ctx context.Context, uid string, gid int) error
- func DeleteAssetGroupAndUpdateSize(ctx context.Context, userID string, gid int) error
- func DeleteKOL(ctx context.Context, userId string) error
- func DeleteKOLLevelConfig(ctx context.Context, level int) error
- func DeleteOfflineDevice(ctx context.Context, ids []string, usedID string) error
- func DeleteOuterAssetGroup(ctx context.Context, userID string, gids []int64) error
- func DeleteUserGroupAsset(ctx context.Context, userID string, gids []int64) error
- func GenerateDeviceMapInfo(infos []*model.DeviceInfo, lang model.Language, noHideIP ...bool) []map[string]interface{}
- func GenerateEligibleOnlineDevices(ctx context.Context) error
- func GetAdminAddedKolLevel(ctx context.Context) (map[string]int, error)
- func GetAllDeviceUserIdFromCache(ctx context.Context, areaId string) (map[string]string, error)
- func GetAllKOLLevels(ctx context.Context) (map[string]*model.KOLLevel, error)
- func GetAllSignInfo() ([]model.SignInfo, error)
- func GetAllUserReferrerUserId(ctx context.Context) (map[string]string, error)
- func GetAppVersion(ctx context.Context, version string, platform string, lang model.Language) (*model.AppVersion, error)
- func GetAreaCnByAreaEn(ctx context.Context, areaEn []string) ([]string, error)
- func GetAreaCount(ctx context.Context, deviceIds []string) (int64, error)
- func GetAreaEnByAreaCn(ctx context.Context, areaCn []string) ([]string, error)
- func GetAreaIDsByHash(ctx context.Context, hash string) ([]string, error)
- func GetAreaMapByEn(ctx context.Context, areaEn []string) ([]model.AreaMap, 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 GetAssetsList(ctx context.Context, cid string, nodeId, areaId string, option QueryOption) (int64, []*model.Asset, error)
- func GetAssetsListByCIds(ctx context.Context, cids []string) ([]*model.Asset, error)
- func GetCacheFullNodeInfo(ctx context.Context) (*model.FullNodeInfo, error)
- func GetCacheLocation(ctx context.Context, ip string, lang model.Language) (*model.Location, error)
- func GetCityCountByDeviceIds(ctx context.Context, deviceIds []string) (int64, error)
- func GetCountryCount(ctx context.Context) (int64, error)
- func GetCreditByUn(ctx context.Context, un string) (int64, error)
- func GetDeviceDistribution(ctx context.Context, lang model.Language) ([]*model.DeviceDistribution, error)
- func GetDeviceInfo(ctx context.Context, deviceId string) (*model.DeviceInfo, 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 GetDeviceInfoListByIds(ctx context.Context, deviceIds []string) ([]*model.DeviceInfo, error)
- func GetDeviceInfoListByKey(ctx context.Context, cond *model.DeviceInfo, option QueryOption) ([]*model.DeviceInfo, int64, error)
- func GetDeviceOnlineIncentiveList(ctx context.Context, deviceId string, option QueryOption) ([]*model.DeviceOnlineIncentive, int64, error)
- func GetDeviceProfileFromCache(ctx context.Context, deviceId string) (map[string]string, error)
- func GetEdgeConfig(ctx context.Context, node string) (*model.EdgeConfig, error)
- func GetFullNodeInfoList(ctx context.Context, cond *model.FullNodeInfo, option QueryOption) ([]*model.FullNodeInfo, int64, error)
- func GetHashAreaIDList(ctx context.Context, uid string) (map[string][]string, error)
- func GetIPFSRecordsByCIDs(ctx context.Context, cids []string) ([]model.SyncIPFSRecord, error)
- func GetIPFSRecordsByUsername(ctx context.Context, un string, page, size int) (int64, []model.SyncIPFSRecord, error)
- func GetIPNodeCount(ctx context.Context, ip, areaId string, option QueryOption) (int64, []*model.IPNodeCount, error)
- func GetInfoByMinerID(minerID string) (model.SignInfo, error)
- func GetInviteCreditByUn(ctx context.Context, un string) (int64, error)
- func GetKOLByUserId(ctx context.Context, userId string) (*model.KOL, error)
- func GetKOLLevelByLevel(ctx context.Context, level int) (*model.KOLLevelConfig, error)
- func GetKolLevelConfig(ctx context.Context, option QueryOption) ([]*model.KOLLevelConfig, int64, error)
- func GetKolList(ctx context.Context, option QueryOption) ([]*model.KOL, int64, error)
- func GetLatestAppVersion(ctx context.Context, platform string, lang model.Language) (model.AppVersion, error)
- func GetLatestAsset(ctx context.Context) (*model.Asset, error)
- func GetLink(ctx context.Context, sb squirrel.SelectBuilder) (*model.Link, 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 GetNoExistCIDs(ctx context.Context, uid string, cids []string) ([]string, error)
- func GetNodeIPChangedRecords(ctx context.Context, id string, option QueryOption) (int64, []*model.NodeIPHistory, error)
- func GetNodeInfos(ctx context.Context, uid string, page, size uint64) ([]NodeStatus, []NodeStatusInfo, error)
- func GetNodeNums(ctx context.Context, usedID string) (int64, int64, int64, int64, error)
- func GetNodesInfo(ctx context.Context, option QueryOption) (int64, []model.NodesInfo, error)
- func GetOneAreaIDByAreaID(ctx context.Context, userID, hash, areaID string) (string, error)
- func GetOneSyncSuccessArea(ctx context.Context, hash string) (string, error)
- func GetOnlineIPCountsFromCache(ctx context.Context, ip string) (int64, error)
- func GetOnlineNodes(ctx context.Context) (int64, error)
- func GetOnlyAssetsByUIDAndGroupID(ctx context.Context, userID string, gids []int64) (map[string][]string, error)
- func GetPageViewCountDailyStat(ctx context.Context, event model.DataCollectionEvent, code string, ...) ([]*model.DateValue, error)
- func GetPageViewIPCountDailyStat(ctx context.Context, event model.DataCollectionEvent, code string, ...) ([]*model.DateValue, error)
- func GetPeakBandwidth(ctx context.Context, userId string) (int64, error)
- func GetPlainDeviceInfoByIds(ctx context.Context, deviceIds []string) ([]*model.PlainDeviceInfo, error)
- func GetQualitiesNodes(ctx context.Context, areaId, nodeId string, option QueryOption) (int64, []*model.QualitiesNode, error)
- func GetQueryDataList(sqlClause string, args ...interface{}) ([]map[string]string, error)
- func GetReferralCodeProfileByUserId(ctx context.Context, userId string) ([]*model.ReferralCodeProfile, error)
- func GetReferralList(ctx context.Context, username string, option QueryOption) (int64, []*model.InviteFrensRecord, error)
- func GetReferralReward(ctx context.Context, userId, fromUserId string) (*model.UserRewardDetail, 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 GetTempAssetInfo(ctx context.Context, hash string) (*model.TempAsset, error)
- func GetTenantByBuilder(ctx context.Context, sb squirrel.SelectBuilder) (*model.Tenant, error)
- func GetTest1Nodes(ctx context.Context, statusCode int64, page, size uint64) (int64, []model.Test1NodeInfo, error)
- func GetTotalNodeStats(ctx context.Context, areaId string) (*model.TotalNodeStats, error)
- func GetTotalUserStats(ctx context.Context) (*model.TotalUserStats, error)
- func GetUnSyncAreaIDs(ctx context.Context, uid, hash string) ([]string, error)
- func GetUnSyncIPFSRecords(ctx context.Context) ([]model.SyncIPFSRecord, error)
- func GetUserAsset(ctx context.Context, hash, uid string) (*model.UserAsset, error)
- func GetUserAssetAreaIDs(ctx context.Context, hash, uid string) ([]string, error)
- func GetUserAssetByBuilder(ctx context.Context, sb squirrel.SelectBuilder) (*model.UserAsset, error)
- func GetUserAssetByHash(ctx context.Context, hash string) (*model.UserAsset, error)
- func GetUserAssetCount(ctx context.Context, hash string) (int64, error)
- func GetUserAssetNotAreaIDs(ctx context.Context, hash, uid string, areaID []string) ([]string, error)
- func GetUserByBuilder(ctx context.Context, sb squirrel.SelectBuilder) (*model.User, error)
- func GetUserByRefCode(ctx context.Context, refCode string) (*model.User, error)
- func GetUserByUsername(ctx context.Context, username string) (*model.User, error)
- func GetUserGroupByParent(ctx context.Context, userID string, pids []int64) ([]int64, error)
- func GetUserIds(ctx context.Context) ([]string, error)
- func GetUserIncome(cond *model.DeviceInfo, option QueryOption) (map[string]map[string]interface{}, error)
- func GetUserL1Reward(ctx context.Context, userId string) (*model.UserL1Reward, error)
- func GetUserReferCodes(ctx context.Context, userId string) ([]*model.ReferralCode, error)
- func GetUserReferralCounter(ctx context.Context, userId string) (*model.ReferralCounter, error)
- func GetUserReferralReward(ctx context.Context, option QueryOption) ([]*model.UserReferralRecord, int64, error)
- func GetUserReferrerNodesDailyStat(ctx context.Context, code string, option QueryOption) ([]*model.DateValue, error)
- func GetUserReferrerUsersDailyStat(ctx context.Context, code string, option QueryOption) ([]*model.DateValue, error)
- func GetUserRewardDetailsByUserID(ctx context.Context, userId string) ([]*model.UserRewardDetail, error)
- func GetVisitCount(ctx context.Context, hash, user_id string) (int64, error)
- func GetWorkerdNodes(ctx context.Context, areaId, nodeId string, option QueryOption) (int64, []*model.WorkerdNode, error)
- func Init(cfg *config.Config) error
- func InsertOrUpdateAssetTransferLog(ctx context.Context, log *model.AssetTransferLog) error
- func IsGeneratedOnlineIncentive(ctx context.Context, date time.Time) (bool, error)
- func ListAssetTransferDetail(ctx context.Context, sb squirrel.SelectBuilder) ([]*model.AssetTransferLog, error)
- func ListBannersCtx(ctx context.Context, platform int64, lang string) ([]*model.Ads, 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 ListNoticesCtx(ctx context.Context, platform int64, lang string) ([]*model.Ads, error)
- func ListOperationLog(ctx context.Context, option QueryOption) ([]*model.OperationLog, int64, error)
- func LoadAllUserReferralReward(ctx context.Context, option QueryOption) ([]*model.UserReferralRecord, error)
- func MoveAssetGroup(ctx context.Context, userID string, groupID, targetGroupID int) error
- func MoveBackDeletedDevice(ctx context.Context, ids []string, usedID string) error
- func NewLogTrace(ctx context.Context, uid string, transferType string, area string) (string, 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 ReleaseLock(rdb *redis.Client, lockKey string, lockValue string) 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 SetEdgeConfig(ctx context.Context, cfg *model.EdgeConfig) error
- func SetMultipleDeviceUserIdToCache(ctx context.Context, areaId string, keyVal map[string]string) error
- func SetOnlineIPCountsToCache(ctx context.Context, data map[string]interface{}) error
- func SumAllUsersReward(ctx context.Context, eligibleOnlineMinutes int) ([]*model.UserReward, 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 TranslateIPLocation(ctx context.Context, info *model.DeviceInfo, lang model.Language)
- func UpdateAppVersion(ctx context.Context, appVer *model.AppVersion) error
- func UpdateAssetBackupResult(ctx context.Context, cid string, backupResult int) error
- func UpdateAssetCid(ctx context.Context, hash, cid string) error
- func UpdateAssetGroup(ctx context.Context, userID, hash string, groupID int) error
- func UpdateAssetGroupName(ctx context.Context, uid, rename string, groupID int) error
- func UpdateAssetName(ctx context.Context, newName, uid, hash string) error
- func UpdateAssetPath(ctx context.Context, cid string, path string) error
- func UpdateAssetShareStatus(ctx context.Context, hash, userID string) error
- func UpdateDeviceInfoDailyUser(ctx context.Context, deviceId, userId string) error
- func UpdateDeviceName(ctx context.Context, deviceInfo *model.DeviceInfo) error
- func UpdateGroupShareStatus(ctx context.Context, userID string, groupID int64) error
- func UpdateIPFSRecordStatus(ctx context.Context, cids []string, areaID string) error
- func UpdateKOL(ctx context.Context, kol *model.KOL) error
- func UpdateKOLLevel(ctx context.Context, kolUserId string, level int) error
- func UpdateKOLLevelConfig(ctx context.Context, levelConf *model.KOLLevelConfig) error
- func UpdateLinkPassAndExpiration(ctx context.Context, link *model.Link) error
- func UpdateNodeOperationStatus(ctx context.Context, uid, nodeID string, operation int64, hours ...int) error
- func UpdateSignature(ctx context.Context, signature, nodeId, areaId, hash string) error
- func UpdateSyncAssetAreas(ctx context.Context, areaID string, hashs []string) error
- func UpdateTest1DeviceName(ctx context.Context, id, name string) error
- func UpdateUnSyncAreaIDs(ctx context.Context, uid, hash string, aids []string) error
- func UpdateUserAPIKeys(ctx context.Context, id int64, buf []byte) error
- func UpdateUserAsset(ctx context.Context, asset *model.UserAsset) error
- func UpdateUserDeviceInfo(ctx context.Context, deviceInfo *model.DeviceInfo) error
- func UpdateUserTotalSize(ctx context.Context, un string, ts int64) error
- func UpdateUserWalletAddress(ctx context.Context, username, address string) error
- func UpsertFullNodeInfo(ctx context.Context, fullNodeInfo *model.FullNodeInfo) error
- func UpsertKOLs(ctx context.Context, kols []*model.KOL) error
- func UpsertLocationInfo(ctx context.Context, out *model.Location, lang model.Language) error
- func UpsertSystemInfo(ctx context.Context, systemInfo *model.SystemInfo) error
- func UserAssetAreaIDs(ctx context.Context, uid, hash string) ([]string, error)
- type ActiveInfoOut
- type AssetCIDInfo
- type AssetGroup
- 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 ComprehensiveStats
- type ComprehensiveStatsWithDay
- type DashBoardInfo
- type DeviceStatistics
- 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 KVMap
- type ListAssetGroupRsp
- type MapInfo
- type NodeStatus
- type NodeStatusInfo
- type OnlyUserGroupAsset
- type QueryOption
- type StatsLimitUser
- type SubAssetDetail
- type UserAndQuest
- type UserAssetDetail
- type UserDeviceProfile
- type UserInfoRes
- type UserStorageFlowInfo
Constants ¶
const ( AdsPlatformPC = 1 AdsPlatformAPP = 2 AdsTypeBanner = 1 AdsTypeNotice = 2 )
const ( AssetTransferTypeDownload = "download" AssetTransferTypeUpload = "upload" AssetTransferStateCreated = 0 AssetTransferStateSuccess = 1 AssetTransferStateFailure = 2 )
const ( BugStateWaiting = 1 BugStateDone = 2 )
const ( FullNodeInfoKeyExpiration = 0 FullNodeInfoKey = "TITAN::FULL_NODE_INFO" )
const ( EligibleTopOnlineTimePercent = 10 IncentiveRewardPercent = 10 )
Variables ¶
var (
// DB reference to database
DB, QDB *sqlx.DB
// RedisCache redis caching instance
RedisCache *redis.Client
)
var ( TenantStateActive = "active" TenantStateInactive = "inactive" )
var ErrNoRow = fmt.Errorf("no matching row found")
var (
GEOLocationKeyPrefix = "TITAN::GEO"
)
Functions ¶
func AcquireLock ¶
func AcquireLock(rdb *redis.Client, lockKey string, lockValue string, expiration time.Duration) (bool, error)
尝试获取分布式锁
func AddAppVersion ¶
func AddAppVersion(ctx context.Context, appVer *model.AppVersion) error
func AddAssetAndUpdateSize ¶
func AddAssetAndUpdateSize(ctx context.Context, asset *model.UserAsset, areaIDs []string, syncArea string) error
AddAssetAndUpdateSize 添加文件信息并修改使用的storage存储空间
func AddAssetGroupVisitCount ¶
AddAssetGroupVisitCount 增加文件组分享次数
func AddAssetHourStorages ¶
func AddAssetHourStorages(ctx context.Context, ahss []model.AssetStorageHour) error
AddAssetHourStorages 批量存储文件小时数据
func AddDataCollection ¶
func AddDataCollection(ctx context.Context, dc *model.DataCollection) error
func AddFilStorages ¶
func AddFilStorages(ctx context.Context, storages []*model.FilStorage) error
func AddIPFSRecords ¶
func AddIPFSRecords(ctx context.Context, irs []model.SyncIPFSRecord) error
AddIPFSRecords 添加ipfs同步记录
func AddKOLLevelConfig ¶
func AddKOLLevelConfig(ctx context.Context, levelConf *model.KOLLevelConfig) error
func AddNewReferralCode ¶
func AddNewReferralCode(ctx context.Context, referralCode *model.ReferralCode) error
func AddOperationLog ¶
func AddOperationLog(ctx context.Context, log *model.OperationLog) error
func AddStorageProvider ¶
func AddStorageProvider(ctx context.Context, sp *model.StorageProvider) error
func AddSubscription ¶
func AddSubscription(ctx context.Context, subscription *model.Subscription) error
func AddTempAssetDownloadCount ¶
AddTempAssetDownloadCount 增加临时文件的下载次数
func AddTempAssetShareCount ¶
AddTempAssetShareCount 增加临时文件的分享信息
func AddUserAssetMap ¶
AddUserAssetMap 增加用户文件映射表
func AddUserSecret ¶
func AddUserSecret(ctx context.Context, userSecret *model.UserSecret) error
func AddVisitCount ¶
AddVisitCount 增加文件访问次数
func AdsListPageCtx ¶
func BugsCountByBuilderCtx ¶
func BugsListPageCtx ¶
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 BulkUpdateUserL1Reward ¶
func BulkUpdateUserL1Reward(ctx context.Context, rewards []*model.UserL1Reward) error
func BulkUpdateUserReward ¶
func BulkUpdateUserRewardDetails ¶
func BulkUpdateUserRewardDetails(ctx context.Context, logs []*model.UserRewardDetail) error
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 CacheIPLocation ¶
func CacheMapInfo ¶
func CheckAssetByMd5AndAreaExists ¶
CheckAssetByMd5AndAreaExists 判断文件是否已经存在
func CheckAssetHashIsExist ¶
CheckAssetHashIsExist 判断文件hash是否存在
func CheckAssetIsSyncByAreaID ¶
CheckAssetIsSyncByAreaID 判断
func CheckIsNodeOwner ¶
CheckIsNodeOwner 校验是否为节点拥有者
func CheckUserAseetNeedDel ¶
func CheckUserAseetNeedDel(ctx context.Context, hash, uid string, areaID []string) ([]string, bool, error)
CheckUserAseetNeedDel 判断文件是否需要删除
func CheckUserAssetIsInAreaID ¶
CheckUserAssetIsInAreaID 判断用户文件是否存在于指定区域
func CheckUserAssetIsOnly ¶
CheckUserAssetIsOnly 判断用户文件是否为唯一存在的
func CountPageViewByEvent ¶
func CountPageViewByEvent(ctx context.Context, event model.DataCollectionEvent, code string, option QueryOption) (ipCount, pvCount int64, err error)
func DelAssetAndUpdateSize ¶
func DelAssetAndUpdateSize(ctx context.Context, hash, userID string, areaID []string, isNeedDel bool) error
DelAssetAndUpdateSize 删除文件信息并修改使用的storage存储空间
func DeleteAssetGroup ¶
DeleteAssetGroup delete asset group
func DeleteAssetGroupAndUpdateSize ¶
DeleteAssetGroupAndUpdateSize 删除文件组并更新用户已使用空间大小
func DeleteOfflineDevice ¶
DeleteOfflineDevice 删除离线设备
func DeleteOuterAssetGroup ¶
DeleteOuterAssetGroup 删除指定的文件组,其内部的文件组先不进行删除
func DeleteUserGroupAsset ¶
DeleteUserGroupAsset 删除用户文件组中的文件
func GenerateDeviceMapInfo ¶
func GetAdminAddedKolLevel ¶
func GetAllKOLLevels ¶
func GetAllSignInfo ¶
func GetAppVersion ¶
func GetAreaCnByAreaEn ¶
GetAreaCnByAreaEn 通过英文的区域名称获取中文的区域名称
func GetAreaEnByAreaCn ¶
GetAreaEnByAreaCn 通过中文的区域名称获取英文的区域名称
func GetAreaIDsByHash ¶
GetAreaIDsByHash 通过hash获取areaids
func GetAreaMapByEn ¶
GetAreaMapByEn 通过英文获取节点区域列表
func GetAssetList ¶
func GetAssetList(ctx context.Context, deviceIds []string, lang model.Language, option QueryOption) ([]*model.DeviceInfo, error)
func GetAssetsByEmptyPath ¶
func GetAssetsList ¶
func GetAssetsListByCIds ¶
func GetCacheFullNodeInfo ¶
func GetCacheFullNodeInfo(ctx context.Context) (*model.FullNodeInfo, error)
func GetCacheLocation ¶
func GetCityCountByDeviceIds ¶
func GetCountryCount ¶
GetCountryCount 获取国家数量
func GetCreditByUn ¶
GetCreditByUn 获取社区奖励
func GetDeviceDistribution ¶
func GetDeviceInfo ¶
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 GetDeviceInfoListByIds ¶
func GetDeviceInfoListByKey ¶
func GetDeviceInfoListByKey(ctx context.Context, cond *model.DeviceInfo, option QueryOption) ([]*model.DeviceInfo, int64, error)
func GetDeviceOnlineIncentiveList ¶
func GetDeviceOnlineIncentiveList(ctx context.Context, deviceId string, option QueryOption) ([]*model.DeviceOnlineIncentive, int64, error)
func GetEdgeConfig ¶
func GetFullNodeInfoList ¶
func GetFullNodeInfoList(ctx context.Context, cond *model.FullNodeInfo, option QueryOption) ([]*model.FullNodeInfo, int64, error)
func GetHashAreaIDList ¶
GetHashAreaIDList 根据用户信息获取区域hash列表
func GetIPFSRecordsByCIDs ¶
GetIPFSRecordsByCIDs 根据cid获取ipfs记录列表
func GetIPFSRecordsByUsername ¶
func GetIPFSRecordsByUsername(ctx context.Context, un string, page, size int) (int64, []model.SyncIPFSRecord, error)
GetIPFSRecordsByUsername 根据用户名获取ipfs同步记录
func GetIPNodeCount ¶
func GetIPNodeCount(ctx context.Context, ip, areaId string, option QueryOption) (int64, []*model.IPNodeCount, error)
func GetInviteCreditByUn ¶
GetInviteCreditByUn 获取社区邀请奖励
func GetKOLLevelByLevel ¶
func GetKolLevelConfig ¶
func GetKolLevelConfig(ctx context.Context, option QueryOption) ([]*model.KOLLevelConfig, int64, error)
func GetKolList ¶
func GetLatestAppVersion ¶
func GetLocationInfoByIp ¶
func GetNoExistCIDs ¶
GetNoExistCIDs 获取用户不存在的cid信息
func GetNodeIPChangedRecords ¶
func GetNodeIPChangedRecords(ctx context.Context, id string, option QueryOption) (int64, []*model.NodeIPHistory, error)
func GetNodeInfos ¶
func GetNodeInfos(ctx context.Context, uid string, page, size uint64) ([]NodeStatus, []NodeStatusInfo, error)
GetNodeInfos 获取用户节点信息
func GetNodeNums ¶
GetNodeNums 获取节点总数
func GetNodesInfo ¶
func GetOneAreaIDByAreaID ¶
GetOneAreaIDByAreaID 根据给定的areaID模糊获取一个准确的areaid
func GetOneSyncSuccessArea ¶
GetOneSyncSuccessArea 随机获取一个同步完成的区域
func GetOnlineNodes ¶
GetOnlineNodes 获取在线的节点数量
func GetOnlyAssetsByUIDAndGroupID ¶
func GetOnlyAssetsByUIDAndGroupID(ctx context.Context, userID string, gids []int64) (map[string][]string, error)
GetOnlyAssetsByUIDAndGroupID 获取用户文件组中唯一存在的文件区域映射
func GetPageViewCountDailyStat ¶
func GetPageViewCountDailyStat(ctx context.Context, event model.DataCollectionEvent, code string, option QueryOption) ([]*model.DateValue, error)
func GetPageViewIPCountDailyStat ¶
func GetPageViewIPCountDailyStat(ctx context.Context, event model.DataCollectionEvent, code string, option QueryOption) ([]*model.DateValue, error)
func GetPlainDeviceInfoByIds ¶
func GetQualitiesNodes ¶
func GetQualitiesNodes(ctx context.Context, areaId, nodeId string, option QueryOption) (int64, []*model.QualitiesNode, error)
func GetQueryDataList ¶
func GetReferralList ¶
func GetReferralList(ctx context.Context, username string, option QueryOption) (int64, []*model.InviteFrensRecord, error)
func GetReferralReward ¶
func GetSecretKey ¶
func GetSignatureByHash ¶
func GetSignatureByNodeId ¶
func GetStorageProvider ¶
func GetTempAssetInfo ¶
GetTempAssetInfo 获取临时文件的信息
func GetTenantByBuilder ¶
func GetTest1Nodes ¶
func GetTest1Nodes(ctx context.Context, statusCode int64, page, size uint64) (int64, []model.Test1NodeInfo, error)
GetTest1Nodes 获取test1节点信息
func GetTotalNodeStats ¶
func GetTotalUserStats ¶
func GetTotalUserStats(ctx context.Context) (*model.TotalUserStats, error)
func GetUnSyncAreaIDs ¶
GetUnSyncAreaIDs 获取未同步的区域
func GetUnSyncIPFSRecords ¶
func GetUnSyncIPFSRecords(ctx context.Context) ([]model.SyncIPFSRecord, error)
GetUnSyncIPFSRecords 获取未同步成功的ipfs文件列表且时间不超过一个小时
func GetUserAsset ¶
GetUserAsset 获取用户文件信息
func GetUserAssetAreaIDs ¶
GetUserAssetAreaIDs 获取用户文件的调度器区域
func GetUserAssetByBuilder ¶
func GetUserAssetByHash ¶
GetUserAssetByHash 获取最先上传文件的用户
func GetUserAssetCount ¶
GetUserAssetCount 获取上传文件的用户数量
func GetUserAssetNotAreaIDs ¶
func GetUserAssetNotAreaIDs(ctx context.Context, hash, uid string, areaID []string) ([]string, error)
GetUserAssetNotAreaIDs 返回不存在的area_id
func GetUserByBuilder ¶
func GetUserByRefCode ¶
func GetUserByUsername ¶
func GetUserGroupByParent ¶
GetUserGroupByParent 通过父级id获取其第一层的子级id
func GetUserIncome ¶
func GetUserIncome(cond *model.DeviceInfo, option QueryOption) (map[string]map[string]interface{}, error)
func GetUserL1Reward ¶
func GetUserReferCodes ¶
func GetUserReferralCounter ¶
func GetUserReferralReward ¶
func GetUserReferralReward(ctx context.Context, option QueryOption) ([]*model.UserReferralRecord, int64, error)
func GetWorkerdNodes ¶
func GetWorkerdNodes(ctx context.Context, areaId, nodeId string, option QueryOption) (int64, []*model.WorkerdNode, error)
func InsertOrUpdateAssetTransferLog ¶
func InsertOrUpdateAssetTransferLog(ctx context.Context, log *model.AssetTransferLog) error
func ListAssetTransferDetail ¶
func ListAssetTransferDetail(ctx context.Context, sb squirrel.SelectBuilder) ([]*model.AssetTransferLog, error)
func ListBannersCtx ¶
func ListFilStorages ¶
func ListFilStorages(ctx context.Context, path string, option QueryOption) ([]*model.FilStorage, int64, error)
func ListLoginLog ¶
func ListNoticesCtx ¶
func ListOperationLog ¶
func ListOperationLog(ctx context.Context, option QueryOption) ([]*model.OperationLog, int64, error)
func LoadAllUserReferralReward ¶
func LoadAllUserReferralReward(ctx context.Context, option QueryOption) ([]*model.UserReferralRecord, error)
func MoveAssetGroup ¶
MoveAssetGroup move a asset group
func MoveBackDeletedDevice ¶
MoveBackDeletedDevice 移回删除的设备
func NewLogTrace ¶
func QueryMaxDeviceDailyInfo ¶
func ReplaceSignInfo ¶
func SetDeviceUserIdToCache ¶
func SetEdgeConfig ¶
func SetEdgeConfig(ctx context.Context, cfg *model.EdgeConfig) error
func SumAllUsersReward ¶
func SumFullNodeInfoFromDeviceInfo ¶
func SumFullNodeInfoFromDeviceInfo(ctx context.Context) (*model.FullNodeInfo, error)
func SumSystemInfo ¶
func SumSystemInfo(ctx context.Context) (*model.SystemInfo, error)
func TranslateIPLocation ¶
func UpdateAppVersion ¶
func UpdateAppVersion(ctx context.Context, appVer *model.AppVersion) error
func UpdateAssetBackupResult ¶
func UpdateAssetCid ¶
UpdateAssetCid 更新文件的cid信息
func UpdateAssetGroup ¶
UpdateAssetGroup update user asset group
func UpdateAssetGroupName ¶
UpdateAssetGroupName update user asset group name
func UpdateAssetName ¶
UpdateAssetName 更新用户文件名
func UpdateAssetShareStatus ¶
UpdateAssetShareStatus 修改文件分享状态
func UpdateDeviceName ¶
func UpdateDeviceName(ctx context.Context, deviceInfo *model.DeviceInfo) error
func UpdateGroupShareStatus ¶
UpdateGroupShareStatus 修改文件组分享状态
func UpdateIPFSRecordStatus ¶
UpdateIPFSRecordStatus 更新ipfs文件同步状态
func UpdateKOLLevelConfig ¶
func UpdateKOLLevelConfig(ctx context.Context, levelConf *model.KOLLevelConfig) error
func UpdateNodeOperationStatus ¶
func UpdateNodeOperationStatus(ctx context.Context, uid, nodeID string, operation int64, hours ...int) error
UpdateNodeOperationStatus 修改节点操作状态
func UpdateSignature ¶
func UpdateSyncAssetAreas ¶
func UpdateTest1DeviceName ¶
UpdateTest1DeviceName 编辑节点设备备注
func UpdateUnSyncAreaIDs ¶
UpdateUnSyncAreaIDs 更新未同步的区域
func UpdateUserAPIKeys ¶
UpdateUserAPIKeys 更新用户密钥
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 AssetCIDInfo ¶
AssetCIDInfo 文件cid信息
type AssetGroup ¶
type AssetGroup struct { ID int64 `db:"id"` UserID string `db:"user_id"` Name string `db:"name"` Parent int64 `db:"parent"` AssetCount int64 `db:"asset_count"` AssetSize int64 `db:"asset_size"` CreatedTime time.Time `db:"created_time"` VistitCount int64 `db:"visit_count"` }
AssetGroup user asset group
func CreateAssetGroup ¶
CreateAssetGroup 创建文件夹
func GetUserAssetGroupInfo ¶
GetUserAssetGroupInfo
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 ComprehensiveStats ¶
type ComprehensiveStats struct { TotalDownloads int `db:"total_downloads" json:"total_downloads"` TotalUploads int `db:"total_uploads" json:"total_uploads"` DownloadSuccess int `db:"download_success" json:"download_success"` UploadSuccess int `db:"upload_success" json:"upload_success"` DownloadFailure int `db:"download_failure" json:"download_failure"` UploadFailure int `db:"upload_failure" json:"upload_failure"` DownloadSize int `db:"download_size" json:"download_size"` UploadSize int `db:"upload_size" json:"upload_size"` DownloadAvgSpeed float64 `db:"download_avg_speed" json:"download_avg_speed"` UploadAvgSpeed float64 `db:"upload_avg_speed" json:"upload_avg_speed"` }
func GetComprehensiveStatsInPeriod ¶
func GetComprehensiveStatsInPeriod(ctx context.Context, start, end int64, area string) (*ComprehensiveStats, error)
获取所有统计数据
func GetComprehensiveStatsInPeriodByUser ¶
func GetComprehensiveStatsInPeriodByUser(ctx context.Context, start, end int64, username string) (*ComprehensiveStats, error)
获取用户的统计
type ComprehensiveStatsWithDay ¶
type ComprehensiveStatsWithDay struct { *ComprehensiveStats Day string `db:"day" json:"day"` }
type DashBoardInfo ¶
type DashBoardInfo struct { Date int64 `db:"hour" json:"-"` DateStr string `db:"-" json:"date"` DownloadCount int64 `db:"download_count" json:"DownloadCount"` PeakBandwidth int64 `db:"peak_bandwidth" json:"PeakBandwidth"` TotalBandwidth int64 `db:"total_traffic" json:"TotalBandwidth"` }
DashBoardInfo 仪表盘数据信息
func GetUserDashboardInfos ¶
GetUserDashboardInfos 通过用户id获取最近24小时的信息
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 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 ListAssetGroupRsp ¶
type ListAssetGroupRsp struct { Total int64 `json:"total"` AssetGroups []*AssetGroup `json:"infos"` }
ListAssetGroupRsp list asset group records
func ListAssetGroupForUser ¶
func ListAssetGroupForUser(ctx context.Context, uid string, parent, limit, offset int) (*ListAssetGroupRsp, error)
ListAssetGroupForUser 根据用户获取对应的文件夹信息
type MapInfo ¶
type MapInfo struct { Name string `json:"name"` NodeType string `json:"nodeType"` Ip string `json:"ip"` Value []float64 `json:"value"` }
func GetDeviceMapInfo ¶
type NodeStatus ¶
NodeStatus 节点状态数量
type NodeStatusInfo ¶
type NodeStatusInfo struct { Name string `db:"device_name" json:"name"` AreaID string `db:"area_id" json:"area_id"` DeviceID string `db:"device_id" json:"node_id"` Status int64 `db:"status" json:"status"` // 1-在线 2-故障 3-离线 11-已退出 ExpTime int64 `db:"deactive_time" json:"exp_time"` }
NodeStatusInfo 节点状态信息
type OnlyUserGroupAsset ¶
type OnlyUserGroupAsset struct { CID string `db:"cid"` Num int64 `db:"num"` AreaID string `db:"area_id"` }
OnlyUserGroupAsset 唯一存在的用户组文件
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 StatsLimitUser ¶
type StatsLimitUser struct { ID int64 `db:"id" json:"id"` Uuid string `db:"uuid" json:"uuid"` Username string `db:"username" json:"username"` UserEmail string `db:"user_email" json:"user_email"` WalletAddress string `db:"wallet_address" json:"wallet_address"` TenantID string `db:"tenant_id" json:"tenant_id"` }
func ListUserByBuilder ¶
func ListUserByBuilder(ctx context.Context, page, size int64, sb squirrel.SelectBuilder) ([]*StatsLimitUser, int64, error)
type SubAssetDetail ¶
SubAssetDetail 部分用户文件信息
type UserAndQuest ¶
type UserAndQuest struct { ID int64 `db:"id" json:"id"` Uuid string `db:"uuid" json:"uuid"` Avatar string `db:"avatar" json:"avatar"` Username string `db:"username" json:"username"` PassHash string `db:"pass_hash" json:"-"` UserEmail string `db:"user_email" json:"user_email"` WalletAddress string `db:"wallet_address" json:"wallet_address"` Role int32 `db:"role" json:"role"` AllocateStorage int `db:"allocate_storage" json:"allocate_storage"` ProjectId int64 `db:"project_id"` Referrer string `db:"referrer" json:"referrer"` ReferrerUserId string `db:"referrer_user_id" json:"-"` ReferralCode string `db:"referral_code" json:"referral_code"` Reward float64 `db:"reward" json:"reward"` ReferralReward float64 `db:"referral_reward" json:"referral_reward"` ClosedTestReward float64 `db:"closed_test_reward" json:"closed_test_reward"` HuygensReward float64 `db:"huygens_reward" json:"huygens_reward"` HuygensReferralReward float64 `db:"huygens_referral_reward" json:"huygens_referral_reward"` HerschelReward float64 `db:"herschel_reward" json:"herschel_reward"` HerschelReferralReward float64 `db:"herschel_referral_reward" json:"herschel_referral_reward"` CassiniReward float64 `db:"cassini_reward" json:"cassini_reward"` CassiniReferralReward float64 `db:"cassini_referral_reward" json:"cassini_referral_reward"` DeviceCount int64 `db:"device_count" json:"device_count"` CreatedAt time.Time `db:"created_at" json:"created_at"` HerschelCredits int64 `json:"herschel_credits" db:"-"` HerschelInviteCredits int64 `json:"herschel_invite_credits" db:"-"` CassiniCredits int64 `json:"cassini_credits" db:"-"` CassiniInviteCredits int64 `json:"cassini_invite_credits" db:"-"` OnlineIncentiveReward float64 `json:"online_incentive_reward" db:"-"` UpdatedAt time.Time `db:"updated_at" json:"-"` DeletedAt time.Time `db:"deleted_at" json:"-"` }
type UserAssetDetail ¶
type UserAssetDetail struct { UserID string `db:"user_id"` Hash string `db:"hash"` Cid string `db:"cid"` AreaIDs []string `db:"-" json:"area_ids"` AreaIDMaps []KVMap `db:"-" json:"area_maps"` AssetName string `db:"asset_name"` AssetType string `db:"asset_type"` Expiration time.Time `db:"expiration"` CreatedTime time.Time `db:"created_time"` TotalSize int64 `db:"total_size"` Password string `db:"password"` GroupID int64 `db:"group_id"` VisitCount int64 `db:"visit_count"` }
UserAssetDetail 用户表详情
func GetUserAssetDetail ¶
func GetUserAssetDetail(ctx context.Context, hash, uid string) (*UserAssetDetail, error)
GetUserAssetDetail 获取用户文件信息
func ListAssets ¶
func ListAssets(ctx context.Context, uid string, limit, offset, groupID int) (int64, []*UserAssetDetail, error)
ListAssets 获取对应文件夹的文件列表
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)
type UserStorageFlowInfo ¶
type UserStorageFlowInfo struct { TotalTraffic int64 `db:"total_traffic"` PeakBandwidth int64 `db:"peak_bandwidth"` }
UserStorageFlowInfo 用户存储流量信息
func GetUserStorageFlowInfo ¶
func GetUserStorageFlowInfo(ctx context.Context, uid string) (*UserStorageFlowInfo, error)
GetUserStorageFlowInfo 获取用户存储流量信息
Source Files ¶
- acme.go
- ads.go
- app_version.go
- area_map.go
- asset_transfer_log.go
- asset_types.go
- assets.go
- base.go
- bugs.go
- cache_event.go
- data_collection.go
- devices_info.go
- edge_config.go
- fil_storage.go
- full_node_info.go
- kol.go
- location.go
- login_log.go
- online_incentive.go
- operation_log.go
- redis_lock.go
- rewards.go
- sign_info.go
- signature.go
- storage.go
- subscription.go
- sync.go
- system_info.go
- tenant.go
- test1_node.go
- user_assets.go
- user_secret.go
- users.go