Documentation
¶
Index ¶
- Constants
- Variables
- func DeploymentStateString(state DeploymentState) string
- func ProviderStateString(state ProviderState) string
- type AWSDataInfo
- type AWSDownloadSources
- type AccessPointRsp
- type ActivationDetail
- type AppType
- type Arguments
- type AssetGroup
- type AssetHash
- type AssetOverview
- type AssetPullProgress
- type AssetPullRequest
- type AssetRecord
- type AssetSource
- type AssetSourceDownloadInfoRsp
- type AssetStateInfo
- type AssetStatistics
- type AssetStats
- type AssetStatus
- type AssetType
- type AssetView
- type AuthUserDeployment
- type AuthUserUploadDownloadAsset
- type CPUCores
- type CandidateCodeInfo
- type CandidateDownloadInfo
- type Certificate
- type ComputeResources
- type ConnectOptions
- type CreateAssetReq
- type CreateSyncAssetReq
- type CreateTunnelReq
- type DeployProjectReq
- type Deployment
- type DeploymentDomain
- type DeploymentID
- type DeploymentState
- type DeploymentType
- type DownloadHistory
- type DownloadSources
- type EdgeDownloadInfo
- type EdgeDownloadInfoList
- type Env
- type Event
- type EventTopics
- type ExecResult
- type ExitProfitRsp
- type FreeUpDiskResp
- type FreeUpDiskState
- type FreeUpDiskStateResp
- type GeneratedCarInfo
- type GetDeploymentListResp
- type GetDeploymentOption
- type GetProviderOption
- type InProgressAsset
- type Ingress
- type JWTPayload
- type LeaseEndpoint
- type ListAssetGroupRsp
- type ListAssetRecordRsp
- type ListAssetSummaryRsp
- type ListDownloadRecordRsp
- type ListNodeAssetRsp
- type ListNodeProfitDetailsRsp
- type ListNodeReplicaRsp
- type ListNodesRsp
- type ListReplicaEventRsp
- type ListReplicaRsp
- type ListRetrieveEventRsp
- type ListStorageStatsRsp
- type ListValidationResultRsp
- type ListWorkloadRecordRsp
- type Log
- type Memory
- type MinioConfig
- type MinioUploadFileEvent
- type NatPunchReq
- type NatType
- type NodeActivation
- type NodeAssetInfo
- type NodeClientType
- type NodeDynamicInfo
- type NodeIPInfo
- type NodeInfo
- type NodeReplicaInfo
- type NodeReplicaRsp
- type NodeReplicaStatus
- type NodeStatus
- type NodeType
- type NodeUploadInfo
- type NodeWorkloadReport
- type OSType
- type OpenRPCDocument
- type Port
- type Ports
- type ProfitDetails
- type ProfitType
- type Project
- type ProjectEvent
- type ProjectInfo
- type ProjectRecordReq
- type ProjectReplicaStatus
- type ProjectReplicas
- type ProjectReq
- type ProjectStateInfo
- type Properties
- type Protocol
- type Provider
- type ProviderState
- type PullAssetReq
- type PullResult
- type RateLimiter
- type RemoveAssetResult
- type ReplicaEvent
- type ReplicaEventInfo
- type ReplicaInfo
- type ReplicaStatus
- type ReplicasStatus
- type ResourcesStatistics
- type RetrieveEvent
- type SchedulerCfg
- type Service
- type ServiceEvent
- type ServiceLog
- type ShellResponse
- type SourceDownloadInfo
- type Storage
- type StorageStat
- type StorageStats
- type Storages
- type SufficientResourceNode
- type Token
- type TokenPayload
- type TunserverReq
- type TunserverRsp
- type UploadInfo
- type UploadProgress
- type UploadingAsset
- type UserAPIKeysInfo
- type UserAccessControl
- type UserAssetDetail
- type UserAssetShareStatus
- type UserAssetSummary
- type UserInfo
- type ValidationInfo
- type ValidationResultInfo
- type ValidationStatus
- type Workload
- type WorkloadEvent
- type WorkloadRecord
- type WorkloadRecordReq
- type WorkloadStatus
Constants ¶
const ( TCP = Protocol("TCP") UDP = Protocol("UDP") )
const ( ShellCodeStdout = 100 ShellCodeStderr = 101 ShellCodeResult = 102 ShellCodeFailure = 103 ShellCodeStdin = 104 ShellCodeTerminalResize = 105 ShellCodeEOF = 106 )
Variables ¶
var AllDeploymentStates = []DeploymentState{DeploymentStateActive, DeploymentStateInActive, DeploymentStateClose}
var FuncAccessControlMap = map[string]UserAccessControl{ "CreateAsset": UserAPIKeyCreateFile, "ListAssets": UserAPIKeyReadFile, "DeleteAsset": UserAPIKeyDeleteFile, "ShareAssets": UserAPIKeyReadFile, "CreateAssetGroup": UserAPIKeyCreateFolder, "ListAssetGroup": UserAPIKeyReadFolder, "DeleteAssetGroup": UserAPIKeyDeleteFolder, "RenameAssetGroup": UserAPIKeyCreateFolder, }
key is function name, value is permission name
var ReplicaStatusAll = []ReplicaStatus{ ReplicaStatusWaiting, ReplicaStatusPulling, ReplicaStatusFailed, ReplicaStatusSucceeded, }
ReplicaStatusAll contains all possible replica statuses
var UserAccessControlAll = []UserAccessControl{ UserAPIKeyReadFile, UserAPIKeyCreateFile, UserAPIKeyDeleteFile, UserAPIKeyReadFolder, UserAPIKeyCreateFolder, UserAPIKeyDeleteFolder, }
Functions ¶
func DeploymentStateString ¶ added in v0.1.21
func DeploymentStateString(state DeploymentState) string
func ProviderStateString ¶ added in v0.1.21
func ProviderStateString(state ProviderState) string
Types ¶
type AWSDataInfo ¶ added in v0.1.13
type AWSDataInfo struct {
Bucket string `db:"bucket"`
Cid string `db:"cid"`
Replicas int `db:"replicas"`
IsDistribute bool `db:"is_distribute"`
DistributeTime time.Time `db:"distribute_time"`
Size float64 `db:"size"`
}
AWSDataInfo aws data
type AWSDownloadSources ¶ added in v0.1.19
type AccessPointRsp ¶ added in v0.1.21
type ActivationDetail ¶ added in v0.1.10
type ActivationDetail struct {
NodeID string `json:"node_id" db:"node_id"`
AreaID string `json:"area_id" `
ActivationKey string `json:"activation_key" db:"activation_key"`
NodeType NodeType `json:"node_type" db:"node_type"`
IP string `json:"ip" db:"ip"`
}
func (*ActivationDetail) Marshal ¶ added in v0.1.10
func (d *ActivationDetail) Marshal() (string, error)
func (*ActivationDetail) Unmarshal ¶ added in v0.1.10
func (d *ActivationDetail) Unmarshal(code string) error
type AssetGroup ¶ added in v0.1.11
type AssetGroup struct {
ID int `db:"id"`
UserID string `db:"user_id"`
Name string `db:"name"`
Parent int `db:"parent"`
AssetCount int `db:"asset_count"`
AssetSize int64 `db:"asset_size"`
CreatedTime time.Time `db:"created_time"`
}
AssetGroup user asset group
type AssetOverview ¶ added in v0.1.11
type AssetOverview struct {
AssetRecord *AssetRecord
UserAssetDetail *UserAssetDetail
VisitCount int
RemainVisitCount int
}
type AssetPullProgress ¶
type AssetPullProgress struct {
CID string
Status ReplicaStatus
Msg string
BlocksCount int
DoneBlocksCount int
Size int64
DoneSize int64
}
AssetPullProgress represents the progress of pulling an asset
type AssetPullRequest ¶ added in v0.1.19
type AssetPullRequest struct {
AssetCID string
Dss *DownloadSources
WorkloadID string
}
type AssetRecord ¶
type AssetRecord struct {
CID string `db:"cid"`
Hash string `db:"hash"`
NeedEdgeReplica int64 `db:"edge_replicas"`
TotalSize int64 `db:"total_size"`
TotalBlocks int64 `db:"total_blocks"`
Expiration time.Time `db:"expiration"`
CreatedTime time.Time `db:"created_time"`
EndTime time.Time `db:"end_time"`
NeedCandidateReplicas int64 `db:"candidate_replicas"`
ServerID dtypes.ServerID `db:"scheduler_sid"`
State string `db:"state"`
NeedBandwidth int64 `db:"bandwidth"` // unit:MiB/
Note string `db:"note"`
Source int64 `db:"source"`
RetryCount int64 `db:"retry_count"`
ReplenishReplicas int64 `db:"replenish_replicas"`
ReplicaInfos []*ReplicaInfo
SPCount int64
}
AssetRecord represents information about an asset record
type AssetSource ¶ added in v0.1.18
type AssetSource int64
AssetSource aws or storage
const ( // AssetSourceAdminPull AssetSourceAdminPull AssetSource = iota // AssetSourceAWS status AssetSourceAWS // AssetSourceStorage status AssetSourceStorage // AssetSourceMinio status AssetSourceMinio )
type AssetSourceDownloadInfoRsp ¶ added in v0.1.18
type AssetSourceDownloadInfoRsp struct {
WorkloadID string
// download from aws
AWSBucket string
// download from aws
AWSKey string
SchedulerURL string
SourceList []*SourceDownloadInfo
}
type AssetStateInfo ¶
type AssetStateInfo struct {
State string `db:"state"`
RetryCount int64 `db:"retry_count"`
Hash string `db:"hash"`
ReplenishReplicas int64 `db:"replenish_replicas"`
}
AssetStateInfo represents information about an asset state
type AssetStatistics ¶
AssetStatistics Statistics on asset pulls and downloads
type AssetStats ¶
type AssetStats struct {
TotalAssetCount int
TotalBlockCount int
WaitCacheAssetCount int
InProgressAssetCID string
DiskUsage float64
}
AssetStats contains statistics about assets
type AssetStatus ¶ added in v0.1.11
type AuthUserDeployment ¶ added in v0.1.21
type AuthUserUploadDownloadAsset ¶ added in v0.1.11
type CandidateCodeInfo ¶ added in v0.1.19
type CandidateDownloadInfo ¶
type CandidateDownloadInfo struct {
NodeID string
Address string
Tk *Token
// download from aws
AWSBucket string
// download from aws
AWSKey string
}
CandidateDownloadInfo represents download information for a candidate
type Certificate ¶ added in v0.1.21
type ComputeResources ¶ added in v0.1.21
type ConnectOptions ¶
type CreateAssetReq ¶ added in v0.1.10
type CreateSyncAssetReq ¶ added in v0.1.21
type CreateSyncAssetReq struct {
AssetCID string
AssetSize int64
ReplicaCount int64
ExpirationDay int
DownloadInfo *SourceDownloadInfo
}
type CreateTunnelReq ¶ added in v0.1.21
type DeployProjectReq ¶ added in v0.1.19
type Deployment ¶ added in v0.1.21
type Deployment struct {
ID DeploymentID `db:"id"`
Name string `db:"name"`
Owner string `db:"owner"`
State DeploymentState `db:"state"`
Version string `db:"version"`
Authority bool `db:"authority"`
Services []*Service
// Internal
Type DeploymentType `db:"type"`
Balance float64 `db:"balance"`
Cost float64 `db:"cost"`
ProviderID string `db:"provider_id"`
Expiration time.Time `db:"expiration"`
CreatedAt time.Time `db:"created_at"`
UpdatedAt time.Time `db:"updated_at"`
ProviderExposeIP string `db:"provider_expose_ip"`
}
type DeploymentDomain ¶ added in v0.1.21
type DeploymentID ¶ added in v0.1.21
type DeploymentID string
type DeploymentState ¶ added in v0.1.21
type DeploymentState int
const ( DeploymentStateActive DeploymentState = iota + 1 DeploymentStateInActive DeploymentStateClose )
type DeploymentType ¶ added in v0.1.21
type DeploymentType int
const (
DeploymentTypeWeb DeploymentType = iota + 1
)
type DownloadHistory ¶
type DownloadHistory struct {
ID string `json:"-"`
NodeID string `json:"node_id" db:"node_id"`
BlockCID string `json:"block_cid" db:"block_cid"`
AssetCID string `json:"asset_cid" db:"asset_cid"`
BlockSize int `json:"block_size" db:"block_size"`
Speed int64 `json:"speed" db:"speed"`
Reward int64 `json:"reward" db:"reward"`
Status int `json:"status" db:"status"`
FailedReason string `json:"failed_reason" db:"failed_reason"`
ClientIP string `json:"client_ip" db:"client_ip"`
CreatedTime time.Time `json:"created_time" db:"created_time"`
CompleteTime time.Time `json:"complete_time" db:"complete_time"`
}
DownloadHistory represents the record of a node download
type DownloadSources ¶ added in v0.1.19
type DownloadSources struct {
Nodes []*SourceDownloadInfo
AWS *AWSDownloadSources
}
type EdgeDownloadInfo ¶
EdgeDownloadInfo represents download information for an edge node
type EdgeDownloadInfoList ¶
type EdgeDownloadInfoList struct {
Infos []*EdgeDownloadInfo
SchedulerURL string
SchedulerKey string
}
EdgeDownloadInfoList represents a list of EdgeDownloadInfo structures along with scheduler URL and key
type EventTopics ¶
type EventTopics string
EventTopics represents topics for pub/sub events
const ( // EventNodeOnline node online event EventNodeOnline EventTopics = "node_online" // EventNodeOffline node offline event EventNodeOffline EventTopics = "node_offline" )
func (EventTopics) String ¶
func (t EventTopics) String() string
type ExecResult ¶ added in v0.1.21
type ExecResult struct {
Code int
}
type ExitProfitRsp ¶ added in v0.1.19
type FreeUpDiskResp ¶ added in v0.1.19
type FreeUpDiskState ¶ added in v0.1.19
type FreeUpDiskStateResp ¶ added in v0.1.19
type FreeUpDiskStateResp struct {
Hashes []*FreeUpDiskState
NextTime int64
}
type GeneratedCarInfo ¶ added in v0.1.10
type GetDeploymentListResp ¶ added in v0.1.21
type GetDeploymentListResp struct {
Deployments []*Deployment
Total int64
}
type GetDeploymentOption ¶ added in v0.1.21
type GetDeploymentOption struct {
Owner string
DeploymentID DeploymentID
ProviderID string
State []DeploymentState
Page int
Size int
}
type GetProviderOption ¶ added in v0.1.21
type GetProviderOption struct {
Owner string
ID string
State []ProviderState
Page int
Size int
}
type InProgressAsset ¶
InProgressAsset represents an asset that is currently being fetched, including its progress details.
type JWTPayload ¶ added in v0.1.10
type JWTPayload struct {
// role base access controller permission
Allow []auth.Permission
ID string
// TODO remove NodeID later, any role id replace as ID
NodeID string
// Extend is json string
Extend string
// The sub permission of user
AccessControlList []UserAccessControl
}
type LeaseEndpoint ¶ added in v0.1.21
type ListAssetGroupRsp ¶ added in v0.1.11
type ListAssetGroupRsp struct {
Total int `json:"total"`
AssetGroups []*AssetGroup `json:"infos"`
}
ListAssetGroupRsp list asset group records
type ListAssetRecordRsp ¶ added in v0.1.11
type ListAssetRecordRsp struct {
Total int `json:"total"`
AssetOverviews []*AssetOverview `json:"asset_infos"`
}
ListAssetRecordRsp list asset records
type ListAssetSummaryRsp ¶ added in v0.1.11
type ListAssetSummaryRsp struct {
Total int `json:"total"`
List []*UserAssetSummary `json:"list"`
}
ListAssetSummaryRsp list asset and group
type ListDownloadRecordRsp ¶
type ListDownloadRecordRsp struct {
Data []DownloadHistory `json:"data"`
Total int64 `json:"total"`
}
ListDownloadRecordRsp download record rsp
type ListNodeAssetRsp ¶ added in v0.1.10
type ListNodeAssetRsp struct {
Total int `json:"total"`
NodeAssetInfos []*NodeAssetInfo `json:"asset_infos"`
}
ListNodeAssetRsp list node assets
type ListNodeProfitDetailsRsp ¶ added in v0.1.18
type ListNodeProfitDetailsRsp struct {
Total int `json:"total"`
Infos []*ProfitDetails `json:"infos"`
}
ListNodeProfitDetailsRsp list node profit
type ListNodeReplicaRsp ¶ added in v0.1.16
type ListNodeReplicaRsp struct {
Total int `json:"total"`
NodeReplicaInfos []*NodeReplicaInfo `json:"infos"`
}
ListNodeReplicaRsp list node assets
type ListNodesRsp ¶
ListNodesRsp list node rsp
type ListReplicaEventRsp ¶ added in v0.1.10
type ListReplicaEventRsp struct {
Total int `json:"total"`
ReplicaEvents []*ReplicaEventInfo `json:"replica_events"`
}
ListReplicaEventRsp list replica events
type ListReplicaRsp ¶ added in v0.1.11
type ListReplicaRsp struct {
Total int `json:"total"`
ReplicaInfos []*ReplicaInfo `json:"replica_infos"`
}
ListReplicaRsp list asset replicas
type ListRetrieveEventRsp ¶ added in v0.1.11
type ListRetrieveEventRsp struct {
Total int `json:"total"`
RetrieveEventInfos []*RetrieveEvent `json:"retrieve_event_infos"`
}
ListRetrieveEventRsp list retrieve event
type ListStorageStatsRsp ¶ added in v0.1.11
type ListStorageStatsRsp struct {
Total int `json:"total"`
Storages []*StorageStats `json:"infos"`
}
ListStorageStatsRsp list storage stats records
type ListValidationResultRsp ¶
type ListValidationResultRsp struct {
Total int `json:"total"`
ValidationResultInfos []ValidationResultInfo `json:"validation_result_infos"`
}
ListValidationResultRsp list validated result
type ListWorkloadRecordRsp ¶ added in v0.1.10
type ListWorkloadRecordRsp struct {
Total int `json:"total"`
WorkloadRecordInfos []*WorkloadRecord `json:"workload_result_infos"`
}
ListWorkloadRecordRsp list workload result
type MinioConfig ¶ added in v0.1.11
type MinioUploadFileEvent ¶ added in v0.1.11
type NatType ¶
type NatType int
NatType represents the type of NAT of a node
const ( // NatTypeUnknown Unknown NAT type NatTypeUnknown NatType = iota // NatTypeNo not nat NatTypeNo // NatTypeSymmetric Symmetric NAT NatTypeSymmetric // NAT4 // NatTypeFullCone Full cone NAT NatTypeFullCone // NAT1 // NatTypeRestricted Restricted NAT NatTypeRestricted // NAT2 // NatTypePortRestricted Port-restricted NAT NatTypePortRestricted // NAT3 )
func (NatType) FromString ¶
type NodeActivation ¶ added in v0.1.10
type NodeAssetInfo ¶ added in v0.1.10
type NodeAssetInfo struct {
Hash string `db:"hash"`
Cid string `db:"cid"`
TotalSize int64 `db:"total_size"`
Expiration time.Time `db:"expiration"`
EndTime time.Time `db:"end_time"`
}
NodeAssetInfo node asset info of web
type NodeClientType ¶ added in v0.1.19
type NodeClientType int
NodeClientType node client type
const ( NodeOther NodeClientType = iota NodeWindows NodeMacos NodeAndroid NodeIOS )
type NodeDynamicInfo ¶ added in v0.1.10
type NodeDynamicInfo struct {
NodeID string `json:"node_id" form:"nodeId" gorm:"column:node_id;comment:;" db:"node_id"`
OnlineDuration int `db:"online_duration"` // unit:Minute
OfflineDuration int `db:"offline_duration"` // unit:Minute
DiskUsage float64 `json:"disk_usage" form:"diskUsage" gorm:"column:disk_usage;comment:;" db:"disk_usage"`
LastSeen time.Time `db:"last_seen"`
Profit float64 `db:"profit"`
PenaltyProfit float64 `db:"penalty_profit"`
TitanDiskUsage float64 `db:"titan_disk_usage"`
AvailableDiskSpace float64 `json:"available_disk_space" form:"availableDiskSpace" gorm:"column:available_disk_space;comment:;" db:"available_disk_space"`
BandwidthUp int64 `json:"bandwidth_up" db:"bandwidth_up"`
BandwidthDown int64 `json:"bandwidth_down" db:"bandwidth_down"`
DownloadTraffic int64 `db:"download_traffic"`
UploadTraffic int64 `db:"upload_traffic"`
}
NodeDynamicInfo contains the real-time status information of a node, such as the last online time, online duration, CPU usage rate, and score changes.
type NodeIPInfo ¶ added in v0.1.11
NodeIPInfo
type NodeInfo ¶
type NodeInfo struct {
IsTestNode bool
Type NodeType
ExternalIP string
InternalIP string
CPUUsage float64
MemoryUsage float64
Status NodeStatus
NATType string
ClientType NodeClientType
BackProjectTime int64
RemoteAddr string
Level int
IncomeIncr float64 // Base points increase every half hour (30 minute)
AreaID string
Mx float64
AssetCount int64 `db:"asset_count"`
RetrieveCount int64 `db:"retrieve_count"`
FirstTime time.Time `db:"first_login_time"`
NetFlowUp int64 `json:"netflow_up" db:"netflow_up" gorm:"column:netflow_up;"`
NetFlowDown int64 `json:"netflow_down" db:"netflow_down" gorm:"column:netflow_down;"`
DiskSpace float64 `json:"disk_space" form:"diskSpace" gorm:"column:disk_space;comment:;" db:"disk_space"`
SystemVersion string `json:"system_version" form:"systemVersion" gorm:"column:system_version;comment:;" db:"system_version"`
DiskType string `json:"disk_type" form:"diskType" gorm:"column:disk_type;comment:;" db:"disk_type"`
IoSystem string `json:"io_system" form:"ioSystem" gorm:"column:io_system;comment:;" db:"io_system"`
NodeName string `json:"node_name" form:"nodeName" gorm:"column:node_name;comment:;" db:"node_name"`
Memory float64 `json:"memory" form:"memory" gorm:"column:memory;comment:;" db:"memory"`
CPUCores int `json:"cpu_cores" form:"cpuCores" gorm:"column:cpu_cores;comment:;" db:"cpu_cores"`
MacLocation string `json:"mac_location" form:"macLocation" gorm:"column:mac_location;comment:;" db:"mac_location"`
PortMapping string `db:"port_mapping"`
SchedulerID dtypes.ServerID `db:"scheduler_sid"`
DeactivateTime int64 `db:"deactivate_time"`
CPUInfo string `json:"cpu_info" form:"cpuInfo" gorm:"column:cpu_info;comment:;" db:"cpu_info"`
GPUInfo string `json:"gpu_info" form:"gpuInfo" gorm:"column:gpu_info;comment:;" db:"gpu_info"`
FreeUpFiskTime time.Time `db:"free_up_disk_time"`
WSServerID string `db:"ws_server_id"`
NodeDynamicInfo
}
NodeInfo contains information about a node.
type NodeReplicaInfo ¶ added in v0.1.16
type NodeReplicaInfo struct {
Hash string `db:"hash"`
Cid string `db:"cid"`
TotalSize int64 `db:"total_size"`
Status ReplicaStatus `db:"status"`
DoneSize int64 `db:"done_size"`
StartTime time.Time `db:"start_time"`
EndTime time.Time `db:"end_time"`
}
NodeReplicaInfo node replica info of web
type NodeReplicaRsp ¶
type NodeReplicaRsp struct {
Replica []*NodeReplicaStatus
TotalCount int
}
NodeReplicaRsp represents the replicas of a node asset
type NodeReplicaStatus ¶
type NodeReplicaStatus struct {
Hash string `db:"hash"`
Status ReplicaStatus `db:"status"`
}
NodeReplicaStatus represents the status of a node cache
type NodeStatus ¶ added in v0.1.10
type NodeStatus int
NodeStatus node status
const ( NodeOffline NodeStatus = iota NodeServicing )
func (NodeStatus) String ¶ added in v0.1.10
func (n NodeStatus) String() string
type NodeType ¶
type NodeType int
NodeType node type
var RunningNodeType NodeType
RunningNodeType represents the type of the running node.
type NodeUploadInfo ¶ added in v0.1.21
type NodeWorkloadReport ¶
type OpenRPCDocument ¶
type OpenRPCDocument map[string]interface{}
type ProfitDetails ¶ added in v0.1.18
type ProfitType ¶ added in v0.1.18
type ProfitType int
ProfitType represents the type of profit
const ( // ProfitTypeBase ProfitTypeBase ProfitType = iota // ProfitTypePull ProfitTypePull // ProfitTypeBePull ProfitTypeBePull // ProfitTypeValidatable ProfitTypeValidatable // ProfitTypeValidator ProfitTypeValidator // ProfitTypeDownload ProfitTypeDownload // ProfitTypeUpload ProfitTypeUpload // ProfitTypeOfflinePenalty ProfitTypeOfflinePenalty // ProfitTypeReimburse ProfitTypeReimburse )
type ProjectEvent ¶ added in v0.1.19
type ProjectEvent int
const ( ProjectEventRemove ProjectEvent = iota ProjectEventAdd ProjectEventNodeOffline ProjectEventStatusChange ProjectEventExpiration )
type ProjectInfo ¶ added in v0.1.19
type ProjectInfo struct {
// uuid
UUID string `db:"id"`
State string `db:"state"`
Name string `db:"name"`
BundleURL string `db:"bundle_url"`
Replicas int64 `db:"replicas"`
ServerID dtypes.ServerID `db:"scheduler_sid"`
Expiration time.Time `db:"expiration"`
CreatedTime time.Time `db:"created_time"`
UserID string `db:"user_id"`
CPUCores int64 `db:"cpu_cores"`
Memory float64 `db:"memory"`
AreaID string `db:"area_id"`
DetailsList []*ProjectReplicas
RetryCount int64 `db:"retry_count"`
ReplenishReplicas int64 `db:"replenish_replicas"`
}
type ProjectRecordReq ¶ added in v0.1.21
type ProjectRecordReq struct {
NodeID string
ProjectID string
BandwidthUpSize float64
BandwidthDownSize float64
StartTime time.Time
EndTime time.Time
}
ProjectRecordReq
type ProjectReplicaStatus ¶ added in v0.1.19
type ProjectReplicaStatus int
const ( ProjectReplicaStatusStarting ProjectReplicaStatus = iota ProjectReplicaStatusStarted ProjectReplicaStatusError ProjectReplicaStatusOffline )
func (ProjectReplicaStatus) String ¶ added in v0.1.19
func (ps ProjectReplicaStatus) String() string
String status to string
type ProjectReplicas ¶ added in v0.1.19
type ProjectReq ¶ added in v0.1.19
type ProjectStateInfo ¶ added in v0.1.19
type ProjectStateInfo struct {
ID string `db:"id"`
State string `db:"state"`
RetryCount int64 `db:"retry_count"`
ReplenishReplicas int64 `db:"replenish_replicas"`
}
ProjectStateInfo represents information about an project state
type Properties ¶ added in v0.1.21
type ProviderState ¶ added in v0.1.21
type ProviderState int
const ( ProviderStateOnline ProviderState = iota + 1 ProviderStateOffline ProviderStateAbnormal )
type PullAssetReq ¶
type PullAssetReq struct {
CID string
Replicas int64
Expiration time.Time
Bucket string
Hash string
Bandwidth int64 // unit:MiB/s
SeedNodeID string
CandidateReplicas int64
CandidateNodeList []string
EdgeNodeList []string
}
PullAssetReq represents a request to pull an asset to Titan
type PullResult ¶
type PullResult struct {
Progresses []*AssetPullProgress
DiskUsage float64
TotalBlocksCount int
AssetCount int
}
PullResult contains information about the result of a data pull
type RateLimiter ¶ added in v0.1.18
type RemoveAssetResult ¶
RemoveAssetResult contains information about the result of removing an asset
type ReplicaEvent ¶ added in v0.1.10
type ReplicaEvent int
const ( // ReplicaEventRemove event ReplicaEventRemove ReplicaEvent = iota // ReplicaEventAdd event ReplicaEventAdd // MinioEventAdd event MinioEventAdd )
type ReplicaEventInfo ¶ added in v0.1.10
type ReplicaEventInfo struct {
NodeID string `db:"node_id"`
Event ReplicaEvent `db:"event"`
Hash string `db:"hash"`
EndTime time.Time `db:"end_time"`
Source int64 `db:"source"`
Cid string `db:"cid"`
TotalSize int64 `db:"total_size"`
Expiration time.Time `db:"expiration"`
}
ReplicaEventInfo replica event info
type ReplicaInfo ¶
type ReplicaInfo struct {
Hash string `db:"hash"`
NodeID string `db:"node_id"`
Status ReplicaStatus `db:"status"`
IsCandidate bool `db:"is_candidate"`
EndTime time.Time `db:"end_time"`
DoneSize int64 `db:"done_size"`
StartTime time.Time `db:"start_time"`
}
ReplicaInfo represents information about an asset replica
type ReplicaStatus ¶
type ReplicaStatus int
ReplicaStatus represents the status of a replica pull
const ( // ReplicaStatusWaiting status ReplicaStatusWaiting ReplicaStatus = iota // ReplicaStatusPulling status ReplicaStatusPulling // ReplicaStatusFailed status ReplicaStatusFailed // ReplicaStatusSucceeded status ReplicaStatusSucceeded )
type ReplicasStatus ¶ added in v0.1.21
type ResourcesStatistics ¶ added in v0.1.21
type ResourcesStatistics struct {
Memory Memory
CPUCores CPUCores
Storage StorageStat
}
type RetrieveEvent ¶ added in v0.1.11
type RetrieveEvent struct {
TokenID string `db:"token_id"`
NodeID string `db:"node_id"`
ClientID string `db:"client_id"`
CID string `db:"cid"`
Size int64 `db:"size"`
CreatedTime int64 `db:"created_time"`
EndTime int64 `db:"end_time"`
Profit float64 `db:"profit"`
}
RetrieveEvent retrieve event
type SchedulerCfg ¶
type SchedulerCfg struct {
SchedulerURL string `db:"scheduler_url"`
AreaID string `db:"area_id"`
Weight int `db:"weight"`
AccessToken string `db:"access_token"`
}
SchedulerCfg scheduler config
type Service ¶ added in v0.1.21
type Service struct {
Image string `db:"image"`
Name string `db:"name"`
Ports Ports `db:"ports"`
Env Env `db:"env"`
Status ReplicasStatus `db:"status"`
ErrorMessage string `db:"error_message"`
Arguments Arguments `db:"arguments"`
ComputeResources
OSType OSType `db:"os_type"`
Replicas int32 `db:"replicas"`
// Internal
ID int64 `db:"id"`
DeploymentID DeploymentID `db:"deployment_id"`
CreatedAt time.Time `db:"created_at"`
UpdatedAt time.Time `db:"updated_at"`
}
type ServiceEvent ¶ added in v0.1.21
type ServiceLog ¶ added in v0.1.21
type ShellResponse ¶ added in v0.1.21
type SourceDownloadInfo ¶ added in v0.1.18
type StorageStat ¶ added in v0.1.21
type StorageStats ¶ added in v0.1.11
type StorageStats struct {
TotalSize int64 `db:"total_storage_size"`
UsedSize int64 `db:"used_storage_size"`
TotalTraffic int64 `db:"total_traffic"`
EnableVIP bool `db:"enable_vip"`
AssetCount int `db:"asset_count"`
}
StorageStats storage stats of user
type SufficientResourceNode ¶ added in v0.1.21
type SufficientResourceNode struct {
Name string
ResourcesStatistics
}
type Token ¶
type Token struct {
ID string
// CipherText encrypted TokenPayload by public key
CipherText string
// Sign signs CipherText by scheduler private key
Sign string
}
Token access download asset
type TokenPayload ¶
type TokenPayload struct {
ID string `db:"token_id"`
NodeID string `db:"node_id"`
AssetCID string `db:"asset_id"`
ClientID string `db:"client_id"`
LimitRate int64 `db:"limit_rate"`
CreatedTime time.Time `db:"created_time"`
Expiration time.Time `db:"expiration"`
}
TokenPayload payload of token
type TunserverReq ¶ added in v0.1.21
type TunserverRsp ¶ added in v0.1.19
type UploadInfo ¶ added in v0.1.19
type UploadInfo struct {
List []*NodeUploadInfo
AlreadyExists bool
}
type UploadProgress ¶ added in v0.1.10
type UploadingAsset ¶ added in v0.1.10
type UploadingAsset struct {
UserID string
TokenExpiration time.Time
Progress *UploadProgress
}
type UserAPIKeysInfo ¶ added in v0.1.11
type UserAccessControl ¶ added in v0.1.11
type UserAccessControl string
const ( UserAPIKeyReadFile UserAccessControl = "readFile" UserAPIKeyCreateFile UserAccessControl = "createFile" UserAPIKeyDeleteFile UserAccessControl = "deleteFile" UserAPIKeyReadFolder UserAccessControl = "readFolder" UserAPIKeyCreateFolder UserAccessControl = "createFolder" UserAPIKeyDeleteFolder UserAccessControl = "deleteFolder" )
type UserAssetDetail ¶ added in v0.1.11
type UserAssetDetail struct {
UserID string `db:"user_id"`
Hash string `db:"hash"`
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 int `db:"group_id"`
}
type UserAssetSummary ¶ added in v0.1.11
type UserAssetSummary struct {
AssetOverview *AssetOverview
AssetGroup *AssetGroup
}
UserAssetSummary user asset and group
type UserInfo ¶ added in v0.1.11
type UserInfo struct {
TotalSize int64 `db:"total_storage_size"`
UsedSize int64 `db:"used_storage_size"`
TotalTraffic int64 `db:"total_traffic"`
PeakBandwidth int64 `db:"peak_bandwidth"`
DownloadCount int64 `db:"download_count"`
EnableVIP bool `db:"enable_vip"`
UpdateTime time.Time `db:"update_peak_time"`
}
type ValidationInfo ¶
ValidationInfo Validation, election related information
type ValidationResultInfo ¶
type ValidationResultInfo struct {
ID int `db:"id"`
RoundID string `db:"round_id"`
NodeID string `db:"node_id"`
Cid string `db:"cid"`
ValidatorID string `db:"validator_id"`
BlockNumber int64 `db:"block_number"` // number of blocks verified
Status ValidationStatus `db:"status"`
Duration int64 `db:"duration"` // validator duration, microsecond
Bandwidth float64 `db:"bandwidth"`
StartTime time.Time `db:"start_time"`
EndTime time.Time `db:"end_time"`
Profit float64 `db:"profit"`
CalculatedProfit bool `db:"calculated_profit"`
TokenID string `db:"token_id"`
FileSaved bool `db:"file_saved"`
NodeCount int `db:"node_count"`
}
ValidationResultInfo validator result info
type ValidationStatus ¶
type ValidationStatus int
ValidationStatus Validation Status
const ( // ValidationStatusCreate is the initial validation status when the validation process starts. ValidationStatusCreate ValidationStatus = iota // ValidationStatusSuccess is the validation status when the validation is success. ValidationStatusSuccess // ValidationStatusCancel is the validation status when the validation is canceled. ValidationStatusCancel // ValidationStatusNodeTimeOut is the validation status when the node times out. ValidationStatusNodeTimeOut // ValidationStatusValidateFail is the validation status when the validation fail. ValidationStatusValidateFail // ValidationStatusValidatorTimeOut is the validation status when the validator times out. ValidationStatusValidatorTimeOut // ValidationStatusGetValidatorBlockErr is the validation status when there is an error getting the blocks from validator. ValidationStatusGetValidatorBlockErr // ValidationStatusValidatorMismatch is the validation status when the validator mismatches. ValidationStatusValidatorMismatch // ValidationStatusLoadDBErr is the validation status when there is an error loading the database. ValidationStatusLoadDBErr // ValidationStatusCIDToHashErr is the validation status when there is an error converting a CID to a hash. ValidationStatusCIDToHashErr // ValidationStatusNodeOffline is the validation status when the node offline. ValidationStatusNodeOffline )
type WorkloadEvent ¶ added in v0.1.18
type WorkloadEvent int
const ( WorkloadEventPull WorkloadEvent = iota WorkloadEventSync WorkloadEventRetrieve )
type WorkloadRecord ¶ added in v0.1.10
type WorkloadRecord struct {
WorkloadID string `db:"workload_id"`
AssetCID string `db:"asset_cid"`
ClientID string `db:"client_id"`
AssetSize int64 `db:"asset_size"`
CreatedTime time.Time `db:"created_time"`
ClientEndTime time.Time `db:"client_end_time"`
Workloads []byte `db:"workloads"`
Status WorkloadStatus `db:"status"`
Event WorkloadEvent `db:"event"`
}
WorkloadReportRecord use to store workloadReport
type WorkloadRecordReq ¶ added in v0.1.18
WorkloadRecordReq use to store workloadReport
type WorkloadStatus ¶ added in v0.1.10
type WorkloadStatus int
WorkloadStatus Workload Status
const ( // WorkloadStatusCreate is the initial workload status when the workload process starts. WorkloadStatusCreate WorkloadStatus = iota // WorkloadStatusSucceeded is the workload status when the workload is succeeded. WorkloadStatusSucceeded // WorkloadStatusFailed is the workload status when the workload is failed. WorkloadStatusFailed // WorkloadStatusInvalid is the workload status when the workload is invalid. WorkloadStatusInvalid )