api

package
v0.0.0-...-8ed7984 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 29, 2024 License: Apache-2.0, MIT Imports: 55 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultAreaId            = "Asia-China-Guangdong-Shenzhen"
	SchedulerConfigKeyPrefix = "TITAN::SCHEDULERCFG"
)
View Source
var (
	ChainHeadKey           = "TITAN::FILECOIN::CHAINHEAD"
	ChainHeadKeyExpiration = 10 * time.Second
)

Functions

func AddDeploymentDomainHandler

func AddDeploymentDomainHandler(c *gin.Context)

func AuthAPIKeyMiddlewareFunc

func AuthAPIKeyMiddlewareFunc() gin.HandlerFunc

AuthAPIKeyMiddlewareFunc makes GinJWTMiddleware implement the Middleware interface.

func AuthRequired

func AuthRequired(authMiddleware *jwt.GinJWTMiddleware) gin.HandlerFunc

func BackupResultHandler

func BackupResultHandler(c *gin.Context)

func BindWalletHandler

func BindWalletHandler(c *gin.Context)

func CacheAllAreas

func CacheAllAreas(ctx context.Context, info []string) error

func CacheDeviceDistribution

func CacheDeviceDistribution(ctx context.Context, info []*model.DeviceDistribution, lang model.Language) error

func CacheRelease

func CacheRelease(ctx context.Context, info []*Release) error

func Cors

func Cors() gin.HandlerFunc

func CreateAppVersionHandler

func CreateAppVersionHandler(c *gin.Context)

func CreateAssetHandler

func CreateAssetHandler(c *gin.Context)

func CreateDeploymentHandler

func CreateDeploymentHandler(c *gin.Context)

func CreateFilStorageHandler

func CreateFilStorageHandler(c *gin.Context)

func CreateGroupHandler

func CreateGroupHandler(c *gin.Context)

func CreateKeyHandler

func CreateKeyHandler(c *gin.Context)

func CreateNewSecretKeyHandler

func CreateNewSecretKeyHandler(c *gin.Context)

func DeleteAssetHandler

func DeleteAssetHandler(c *gin.Context)

func DeleteDeploymentDomainHandler

func DeleteDeploymentDomainHandler(c *gin.Context)

func DeleteDeploymentHandler

func DeleteDeploymentHandler(c *gin.Context)

func DeleteGroupHandler

func DeleteGroupHandler(c *gin.Context)

func DeleteKeyHandler

func DeleteKeyHandler(c *gin.Context)

func DeviceBindingHandler

func DeviceBindingHandler(c *gin.Context)

func DeviceUnBindingHandlerOld

func DeviceUnBindingHandlerOld(c *gin.Context)

func DeviceUpdateHandler

func DeviceUpdateHandler(c *gin.Context)

func GenerateCodeHandler

func GenerateCodeHandler(c *gin.Context)

func GetAPIKeyPermsHandler

func GetAPIKeyPermsHandler(c *gin.Context)

func GetAllAreas

func GetAllAreas(c *gin.Context)

func GetAllAreasFromCache

func GetAllAreasFromCache(ctx context.Context) ([]string, error)

func GetAllocateStorageHandler

func GetAllocateStorageHandler(c *gin.Context)

func GetAppVersionHandler

func GetAppVersionHandler(c *gin.Context)

func GetAssetAllListHandler

func GetAssetAllListHandler(c *gin.Context)

func GetAssetCountHandler

func GetAssetCountHandler(c *gin.Context)

func GetAssetGroupListHandler

func GetAssetGroupListHandler(c *gin.Context)

func GetAssetInfoHandler

func GetAssetInfoHandler(c *gin.Context)

func GetAssetListHandler

func GetAssetListHandler(c *gin.Context)

func GetAssetStatusHandler

func GetAssetStatusHandler(c *gin.Context)

func GetBackupAssetsHandler

func GetBackupAssetsHandler(c *gin.Context)

func GetBlockHeightHandler

func GetBlockHeightHandler(c *gin.Context)

func GetCacheDaysHandler

func GetCacheDaysHandler(c *gin.Context)

func GetCacheHourHandler

func GetCacheHourHandler(c *gin.Context)

func GetCacheListHandler

func GetCacheListHandler(c *gin.Context)

func GetCarFileCountHandler

func GetCarFileCountHandler(c *gin.Context)

func GetDefaultTitanCandidateEntrypointInfo

func GetDefaultTitanCandidateEntrypointInfo() (string, string)

GetDefaultTitanCandidateEntrypointInfo specify candidate to upload file in testnet, only for storage api

func GetDeploymentDomainHandler

func GetDeploymentDomainHandler(c *gin.Context)

func GetDeploymentEventsHandler

func GetDeploymentEventsHandler(c *gin.Context)

func GetDeploymentLogsHandler

func GetDeploymentLogsHandler(c *gin.Context)

func GetDeploymentManifestHandler

func GetDeploymentManifestHandler(c *gin.Context)

func GetDeploymentShellHandler

func GetDeploymentShellHandler(c *gin.Context)

func GetDeploymentsHandler

func GetDeploymentsHandler(c *gin.Context)

func GetDeviceActiveInfoHandler

func GetDeviceActiveInfoHandler(c *gin.Context)

func GetDeviceDiagnosisDailyByDeviceIdHandler

func GetDeviceDiagnosisDailyByDeviceIdHandler(c *gin.Context)

func GetDeviceDiagnosisDailyByUserIdHandler

func GetDeviceDiagnosisDailyByUserIdHandler(c *gin.Context)

func GetDeviceDiagnosisHourHandler

func GetDeviceDiagnosisHourHandler(c *gin.Context)

func GetDeviceDistributionFromCache

func GetDeviceDistributionFromCache(ctx context.Context, lang model.Language) ([]*model.DeviceDistribution, error)

func GetDeviceDistributionHandler

func GetDeviceDistributionHandler(c *gin.Context)

func GetDeviceInfoDailyHandler

func GetDeviceInfoDailyHandler(c *gin.Context)

func GetDeviceInfoHandler

func GetDeviceInfoHandler(c *gin.Context)

func GetDeviceProfileHandler

func GetDeviceProfileHandler(c *gin.Context)

func GetDeviceStatusHandler

func GetDeviceStatusHandler(c *gin.Context)

func GetDiskDaysHandler

func GetDiskDaysHandler(c *gin.Context)

func GetFilStorageListHandler

func GetFilStorageListHandler(c *gin.Context)

func GetGroupsHandler

func GetGroupsHandler(c *gin.Context)

func GetIndexInfoHandler

func GetIndexInfoHandler(c *gin.Context)

func GetKeyListHandler

func GetKeyListHandler(c *gin.Context)

func GetLocation

func GetLocation(ctx context.Context, ipAddr string) (*model.Location, error)

func GetLocationHandler

func GetLocationHandler(c *gin.Context)

func GetLoginLogHandler

func GetLoginLogHandler(c *gin.Context)

func GetMapByCidHandler

func GetMapByCidHandler(c *gin.Context)

func GetMapInfoHandler

func GetMapInfoHandler(c *gin.Context)

func GetNodeDailyTrendHandler

func GetNodeDailyTrendHandler(c *gin.Context)

func GetNodesInfoHandler

func GetNodesInfoHandler(c *gin.Context)

func GetNonceStringHandler

func GetNonceStringHandler(c *gin.Context)

func GetNumericVerifyCodeHandler

func GetNumericVerifyCodeHandler(c *gin.Context)

func GetOperationLogHandler

func GetOperationLogHandler(c *gin.Context)

func GetProfitDetailsHandler

func GetProfitDetailsHandler(c *gin.Context)

func GetProvidersHandler

func GetProvidersHandler(c *gin.Context)

func GetQueryInfoHandler

func GetQueryInfoHandler(c *gin.Context)

func GetReferralListHandler

func GetReferralListHandler(c *gin.Context)

func GetReleasesHandler

func GetReleasesHandler(c *gin.Context)

func GetReplicaListHandler

func GetReplicaListHandler(c *gin.Context)

func GetRetrievalListHandler

func GetRetrievalListHandler(c *gin.Context)

func GetShareLinkHandler

func GetShareLinkHandler(c *gin.Context)

func GetStorageDailyHandler

func GetStorageDailyHandler(c *gin.Context)

func GetStorageHourHandler

func GetStorageHourHandler(c *gin.Context)

func GetStorageSizeHandler

func GetStorageSizeHandler(c *gin.Context)

func GetUserAccessTokenHandler

func GetUserAccessTokenHandler(c *gin.Context)

func GetUserDeviceProfileHandler

func GetUserDeviceProfileHandler(c *gin.Context)

func GetUserDevicesCountHandler

func GetUserDevicesCountHandler(c *gin.Context)

func GetUserInfo

func GetUserInfo(ctx context.Context, key string) int64

func GetUserInfoHandler

func GetUserInfoHandler(c *gin.Context)

func GetUserNearestIP

func GetUserNearestIP(ctx context.Context, userIP string, ipList []string, coordinate IPCoordinate) (string, error)

func GetUserVipInfoHandler

func GetUserVipInfoHandler(c *gin.Context)

func GetValidationListHandler

func GetValidationListHandler(c *gin.Context)

func GetWithdrawListHandler

func GetWithdrawListHandler(c *gin.Context)

func ListStorageStats

func ListStorageStats(c *gin.Context)

func MoveAssetToGroupHandler

func MoveAssetToGroupHandler(c *gin.Context)

func MoveGroupToGroupHandler

func MoveGroupToGroupHandler(c *gin.Context)

func PasswordRest

func PasswordRest(c *gin.Context)

func QueryDeviceCodeHandler

func QueryDeviceCodeHandler(c *gin.Context)

func QueryStorageDaily

func QueryStorageDaily(ctx context.Context, userId, startTime, endTime string) []*dao.UserInfoRes

func RegisterRouterWithAPIKey

func RegisterRouterWithAPIKey(router *gin.Engine)

func RegisterRouterWithJWT

func RegisterRouterWithJWT(router *gin.Engine, cfg config.Config)

func RegisterRouters

func RegisterRouters(route *gin.Engine, cfg config.Config)

func RenameGroupHandler

func RenameGroupHandler(c *gin.Context)

func RequestLoggerMiddleware

func RequestLoggerMiddleware() gin.HandlerFunc

func SaveProviderLocation

func SaveProviderLocation(providerId string) error

func SetPeakBandwidth

func SetPeakBandwidth(userId string)

func SetUserInfo

func SetUserInfo(ctx context.Context, key string, peakBandwidth int64, expireTime time.Duration) error

func ShareAssetsHandler

func ShareAssetsHandler(c *gin.Context)

func ShareLinkHandler

func ShareLinkHandler(c *gin.Context)

func SubscribeHandler

func SubscribeHandler(c *gin.Context)

func UnBindWalletHandler

func UnBindWalletHandler(c *gin.Context)

func UpdateDeploymentHandler

func UpdateDeploymentHandler(c *gin.Context)

func UpdateShareStatusHandler

func UpdateShareStatusHandler(c *gin.Context)

func UserRegister

func UserRegister(c *gin.Context)

func VerifyMessage

func VerifyMessage(message string, signedMessage string) (string, error)

func WithdrawHandler

func WithdrawHandler(c *gin.Context)

Types

type AccessOverview

type AccessOverview struct {
	AssetRecord      *types.AssetRecord
	UserAssetDetail  *types.UserAssetDetail
	VisitCount       int
	RemainVisitCount int
	FilcoinCount     int64
}

type AssetOrGroup

type AssetOrGroup struct {
	AssetOverview *AccessOverview
	Group         interface{}
}

type DeviceRewardRule

type DeviceRewardRule struct {
	NatRule       []Rule `json:"nat_rule"`
	NodeCountRule []Rule `json:"node_count_rule"`
	BandwidthRule []Rule `json:"bandwidth_rule"`
}

type IPCoordinate

type IPCoordinate interface {
	GetLatLng(ctx context.Context, ip string) (float64, float64, error)
}

func NewIPCoordinate

func NewIPCoordinate() IPCoordinate

type JsonObject

type JsonObject map[string]interface{}

type NodeDailyTrend

type NodeDailyTrend struct {
	X string              `json:"x"`
	Y *model.FullNodeInfo `json:"y"`
}

type NonceStringType

type NonceStringType string
const (
	NonceStringTypeRegister  NonceStringType = "1"
	NonceStringTypeLogin     NonceStringType = "2"
	NonceStringTypeReset     NonceStringType = "3"
	NonceStringTypeSignature NonceStringType = "4"
)

type Release

type Release struct {
	OS          string `json:"os"`
	Arch        string `json:"arch"`
	Version     string `json:"version"`
	DownloadURL string `json:"download_url"`
}

func GetReleaseFromCache

func GetReleaseFromCache(ctx context.Context) ([]*Release, error)

type Rule

type Rule struct {
	Name     string  `json:"name"`
	FullName string  `json:"full_name"`
	Score    float64 `json:"score"`
	Current  bool    `json:"current"`
}

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer(cfg config.Config) (*Server, error)

func (*Server) Close

func (s *Server) Close()

func (*Server) Run

func (s *Server) Run()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL