Documentation
¶
Index ¶
- Constants
- Variables
- func AllowUserAccess(ctx context.Context, perms auth.Permission, funcName string) bool
- func ErrorIsIn(err error, errorTypes []error) bool
- func GetInternalStructs(in interface{}) []interface{}
- func HasPerm(ctx context.Context, defaultPerm auth.Permission, perms auth.Permission) bool
- func PermissionedProxy(validPerms []auth.Permission, defaultPerms auth.Permission, in interface{}, ...)
- func WithPerm(ctx context.Context, perms []auth.Permission) context.Context
- func WithUserAccessControl(ctx context.Context, acl []types.UserAccessControl) context.Context
- type APIVersion
- type AccessPoint
- type Asset
- type AssetAPI
- type AssetAPIStruct
- func (s *AssetAPIStruct) AddAWSData(p0 context.Context, p1 []types.AWSDataInfo) error
- func (s *AssetAPIStruct) CreateAsset(p0 context.Context, p1 *types.CreateAssetReq) (*types.UploadInfo, error)
- func (s *AssetAPIStruct) CreateSyncAsset(p0 context.Context, p1 *types.CreateSyncAssetReq) error
- func (s *AssetAPIStruct) GenerateTokenForDownloadSource(p0 context.Context, p1 string, p2 string) (*types.SourceDownloadInfo, error)
- func (s *AssetAPIStruct) GenerateTokenForDownloadSources(p0 context.Context, p1 string) ([]*types.SourceDownloadInfo, error)
- func (s *AssetAPIStruct) GetActiveAssetRecords(p0 context.Context, p1 int, p2 int) (*types.ListAssetRecordRsp, error)
- func (s *AssetAPIStruct) GetAssetCount(p0 context.Context) (int, error)
- func (s *AssetAPIStruct) GetAssetDownloadResults(p0 context.Context, p1 string, p2 time.Time, p3 time.Time) (*types.ListAssetDownloadRsp, error)
- func (s *AssetAPIStruct) GetAssetListForBucket(p0 context.Context, p1 uint32) ([]string, error)
- func (s *AssetAPIStruct) GetAssetRecord(p0 context.Context, p1 string) (*types.AssetRecord, error)
- func (s *AssetAPIStruct) GetAssetRecords(p0 context.Context, p1 int, p2 int, p3 []string, p4 dtypes.ServerID) ([]*types.AssetRecord, error)
- func (s *AssetAPIStruct) GetAssetRecordsByDateRange(p0 context.Context, p1 int, p2 int, p3 time.Time, p4 time.Time) (*types.ListAssetRecordRsp, error)
- func (s *AssetAPIStruct) GetAssetRecordsWithCIDs(p0 context.Context, p1 []string) ([]*types.AssetRecord, error)
- func (s *AssetAPIStruct) GetAssetsForNode(p0 context.Context, p1 string, p2 int, p3 int) (*types.ListNodeAssetRsp, error)
- func (s *AssetAPIStruct) GetDownloadResultsFromAssets(p0 context.Context, p1 []string, p2 time.Time, p3 time.Time) ([]*types.AssetDownloadResultRsp, error)
- func (s *AssetAPIStruct) GetFailedReplicaByCID(p0 context.Context, p1 string, p2 int, p3 int) (*types.ListAssetReplicaEventRsp, error)
- func (s *AssetAPIStruct) GetFailedReplicaByNode(p0 context.Context, p1 string, p2 int, p3 int) (*types.ListAssetReplicaEventRsp, error)
- func (s *AssetAPIStruct) GetNodeAssetReplicasByHashes(p0 context.Context, p1 string, p2 []string) ([]*types.ReplicaInfo, error)
- func (s *AssetAPIStruct) GetReplicaEventsForNode(p0 context.Context, p1 string, p2 int, p3 int) (*types.ListAssetReplicaEventRsp, error)
- func (s *AssetAPIStruct) GetReplicas(p0 context.Context, p1 string, p2 int, p3 int) (*types.ListReplicaRsp, error)
- func (s *AssetAPIStruct) GetReplicasForNode(p0 context.Context, p1 string, p2 int, p3 int, p4 []types.ReplicaStatus) (*types.ListNodeReplicaRsp, error)
- func (s *AssetAPIStruct) GetSucceededReplicaByCID(p0 context.Context, p1 string, p2 int, p3 int) (*types.ListReplicaRsp, error)
- func (s *AssetAPIStruct) GetSucceededReplicaByNode(p0 context.Context, p1 string, p2 int, p3 int) (*types.ListReplicaRsp, error)
- func (s *AssetAPIStruct) LoadAWSData(p0 context.Context, p1 int, p2 int, p3 bool) ([]*types.AWSDataInfo, error)
- func (s *AssetAPIStruct) MinioUploadFileEvent(p0 context.Context, p1 *types.MinioUploadFileEvent) error
- func (s *AssetAPIStruct) NodeRemoveAssetResult(p0 context.Context, p1 types.RemoveAssetResult) error
- func (s *AssetAPIStruct) PullAsset(p0 context.Context, p1 *types.PullAssetReq) error
- func (s *AssetAPIStruct) RePullFailedAssets(p0 context.Context, p1 []types.AssetHash) error
- func (s *AssetAPIStruct) RemoveAssetRecord(p0 context.Context, p1 string) error
- func (s *AssetAPIStruct) RemoveAssetRecords(p0 context.Context, p1 []string) error
- func (s *AssetAPIStruct) RemoveAssetReplica(p0 context.Context, p1 string, p2 string) error
- func (s *AssetAPIStruct) RemoveNodeFailedReplica(p0 context.Context) error
- func (s *AssetAPIStruct) ResetAssetReplicaCount(p0 context.Context, p1 string, p2 int) error
- func (s *AssetAPIStruct) ShareAssetV2(p0 context.Context, p1 *types.ShareAssetReq) (*types.ShareAssetRsp, error)
- func (s *AssetAPIStruct) StopAssetRecord(p0 context.Context, p1 []string) error
- func (s *AssetAPIStruct) SwitchFillDiskTimer(p0 context.Context, p1 bool) error
- func (s *AssetAPIStruct) UpdateAssetExpiration(p0 context.Context, p1 string, p2 time.Time) error
- type AssetAPIStub
- func (s *AssetAPIStub) AddAWSData(p0 context.Context, p1 []types.AWSDataInfo) error
- func (s *AssetAPIStub) CreateAsset(p0 context.Context, p1 *types.CreateAssetReq) (*types.UploadInfo, error)
- func (s *AssetAPIStub) CreateSyncAsset(p0 context.Context, p1 *types.CreateSyncAssetReq) error
- func (s *AssetAPIStub) GenerateTokenForDownloadSource(p0 context.Context, p1 string, p2 string) (*types.SourceDownloadInfo, error)
- func (s *AssetAPIStub) GenerateTokenForDownloadSources(p0 context.Context, p1 string) ([]*types.SourceDownloadInfo, error)
- func (s *AssetAPIStub) GetActiveAssetRecords(p0 context.Context, p1 int, p2 int) (*types.ListAssetRecordRsp, error)
- func (s *AssetAPIStub) GetAssetCount(p0 context.Context) (int, error)
- func (s *AssetAPIStub) GetAssetDownloadResults(p0 context.Context, p1 string, p2 time.Time, p3 time.Time) (*types.ListAssetDownloadRsp, error)
- func (s *AssetAPIStub) GetAssetListForBucket(p0 context.Context, p1 uint32) ([]string, error)
- func (s *AssetAPIStub) GetAssetRecord(p0 context.Context, p1 string) (*types.AssetRecord, error)
- func (s *AssetAPIStub) GetAssetRecords(p0 context.Context, p1 int, p2 int, p3 []string, p4 dtypes.ServerID) ([]*types.AssetRecord, error)
- func (s *AssetAPIStub) GetAssetRecordsByDateRange(p0 context.Context, p1 int, p2 int, p3 time.Time, p4 time.Time) (*types.ListAssetRecordRsp, error)
- func (s *AssetAPIStub) GetAssetRecordsWithCIDs(p0 context.Context, p1 []string) ([]*types.AssetRecord, error)
- func (s *AssetAPIStub) GetAssetsForNode(p0 context.Context, p1 string, p2 int, p3 int) (*types.ListNodeAssetRsp, error)
- func (s *AssetAPIStub) GetDownloadResultsFromAssets(p0 context.Context, p1 []string, p2 time.Time, p3 time.Time) ([]*types.AssetDownloadResultRsp, error)
- func (s *AssetAPIStub) GetFailedReplicaByCID(p0 context.Context, p1 string, p2 int, p3 int) (*types.ListAssetReplicaEventRsp, error)
- func (s *AssetAPIStub) GetFailedReplicaByNode(p0 context.Context, p1 string, p2 int, p3 int) (*types.ListAssetReplicaEventRsp, error)
- func (s *AssetAPIStub) GetNodeAssetReplicasByHashes(p0 context.Context, p1 string, p2 []string) ([]*types.ReplicaInfo, error)
- func (s *AssetAPIStub) GetReplicaEventsForNode(p0 context.Context, p1 string, p2 int, p3 int) (*types.ListAssetReplicaEventRsp, error)
- func (s *AssetAPIStub) GetReplicas(p0 context.Context, p1 string, p2 int, p3 int) (*types.ListReplicaRsp, error)
- func (s *AssetAPIStub) GetReplicasForNode(p0 context.Context, p1 string, p2 int, p3 int, p4 []types.ReplicaStatus) (*types.ListNodeReplicaRsp, error)
- func (s *AssetAPIStub) GetSucceededReplicaByCID(p0 context.Context, p1 string, p2 int, p3 int) (*types.ListReplicaRsp, error)
- func (s *AssetAPIStub) GetSucceededReplicaByNode(p0 context.Context, p1 string, p2 int, p3 int) (*types.ListReplicaRsp, error)
- func (s *AssetAPIStub) LoadAWSData(p0 context.Context, p1 int, p2 int, p3 bool) ([]*types.AWSDataInfo, error)
- func (s *AssetAPIStub) MinioUploadFileEvent(p0 context.Context, p1 *types.MinioUploadFileEvent) error
- func (s *AssetAPIStub) NodeRemoveAssetResult(p0 context.Context, p1 types.RemoveAssetResult) error
- func (s *AssetAPIStub) PullAsset(p0 context.Context, p1 *types.PullAssetReq) error
- func (s *AssetAPIStub) RePullFailedAssets(p0 context.Context, p1 []types.AssetHash) error
- func (s *AssetAPIStub) RemoveAssetRecord(p0 context.Context, p1 string) error
- func (s *AssetAPIStub) RemoveAssetRecords(p0 context.Context, p1 []string) error
- func (s *AssetAPIStub) RemoveAssetReplica(p0 context.Context, p1 string, p2 string) error
- func (s *AssetAPIStub) RemoveNodeFailedReplica(p0 context.Context) error
- func (s *AssetAPIStub) ResetAssetReplicaCount(p0 context.Context, p1 string, p2 int) error
- func (s *AssetAPIStub) ShareAssetV2(p0 context.Context, p1 *types.ShareAssetReq) (*types.ShareAssetRsp, error)
- func (s *AssetAPIStub) StopAssetRecord(p0 context.Context, p1 []string) error
- func (s *AssetAPIStub) SwitchFillDiskTimer(p0 context.Context, p1 bool) error
- func (s *AssetAPIStub) UpdateAssetExpiration(p0 context.Context, p1 string, p2 time.Time) error
- type AssetStruct
- func (s *AssetStruct) AddAssetView(p0 context.Context, p1 []string) error
- func (s *AssetStruct) ClearFreeUpDisk(p0 context.Context) error
- func (s *AssetStruct) CreateAsset(p0 context.Context, p1 *types.AuthUserUploadDownloadAsset) (string, error)
- func (s *AssetStruct) DeleteAsset(p0 context.Context, p1 string) error
- func (s *AssetStruct) GetAssetProgresses(p0 context.Context, p1 []string) (*types.PullResult, error)
- func (s *AssetStruct) GetAssetStats(p0 context.Context) (*types.AssetStats, error)
- func (s *AssetStruct) GetAssetView(p0 context.Context) (*types.AssetView, error)
- func (s *AssetStruct) GetAssetsInBucket(p0 context.Context, p1 int) ([]string, error)
- func (s *AssetStruct) GetPullingAssetInfo(p0 context.Context) (*types.InProgressAsset, error)
- func (s *AssetStruct) PullAsset(p0 context.Context, p1 string, p2 []*types.CandidateDownloadInfo) error
- func (s *AssetStruct) PullAssetFromAWS(p0 context.Context, p1 string, p2 string) error
- func (s *AssetStruct) PullAssetV2(p0 context.Context, p1 *types.AssetPullRequest) error
- func (s *AssetStruct) RequestFreeUpDisk(p0 context.Context, p1 float64) error
- func (s *AssetStruct) StateFreeUpDisk(p0 context.Context) (*types.FreeUpDiskStateResp, error)
- func (s *AssetStruct) SyncAssetViewAndData(p0 context.Context) error
- type AssetStub
- func (s *AssetStub) AddAssetView(p0 context.Context, p1 []string) error
- func (s *AssetStub) ClearFreeUpDisk(p0 context.Context) error
- func (s *AssetStub) CreateAsset(p0 context.Context, p1 *types.AuthUserUploadDownloadAsset) (string, error)
- func (s *AssetStub) DeleteAsset(p0 context.Context, p1 string) error
- func (s *AssetStub) GetAssetProgresses(p0 context.Context, p1 []string) (*types.PullResult, error)
- func (s *AssetStub) GetAssetStats(p0 context.Context) (*types.AssetStats, error)
- func (s *AssetStub) GetAssetView(p0 context.Context) (*types.AssetView, error)
- func (s *AssetStub) GetAssetsInBucket(p0 context.Context, p1 int) ([]string, error)
- func (s *AssetStub) GetPullingAssetInfo(p0 context.Context) (*types.InProgressAsset, error)
- func (s *AssetStub) PullAsset(p0 context.Context, p1 string, p2 []*types.CandidateDownloadInfo) error
- func (s *AssetStub) PullAssetFromAWS(p0 context.Context, p1 string, p2 string) error
- func (s *AssetStub) PullAssetV2(p0 context.Context, p1 *types.AssetPullRequest) error
- func (s *AssetStub) RequestFreeUpDisk(p0 context.Context, p1 float64) error
- func (s *AssetStub) StateFreeUpDisk(p0 context.Context) (*types.FreeUpDiskStateResp, error)
- func (s *AssetStub) SyncAssetViewAndData(p0 context.Context) error
- type Candidate
- type CandidateStruct
- func (s *CandidateStruct) CalculateExitProfit(p0 context.Context) (types.ExitProfitRsp, error)
- func (s *CandidateStruct) CheckNetworkConnectable(p0 context.Context, p1 string, p2 string) (bool, error)
- func (s *CandidateStruct) CheckNetworkConnectivity(p0 context.Context, p1 string, p2 string) error
- func (s *CandidateStruct) DeactivateNode(p0 context.Context) error
- func (s *CandidateStruct) GetBlocksWithAssetCID(p0 context.Context, p1 string, p2 int64, p3 int) ([]string, error)
- func (s *CandidateStruct) GetExternalAddress(p0 context.Context) (string, error)
- func (s *CandidateStruct) GetMinioConfig(p0 context.Context) (*types.MinioConfig, error)
- func (s *CandidateStruct) WaitQuiet(p0 context.Context) error
- type CandidateStub
- func (s *CandidateStub) CalculateExitProfit(p0 context.Context) (types.ExitProfitRsp, error)
- func (s *CandidateStub) CheckNetworkConnectable(p0 context.Context, p1 string, p2 string) (bool, error)
- func (s *CandidateStub) CheckNetworkConnectivity(p0 context.Context, p1 string, p2 string) error
- func (s *CandidateStub) DeactivateNode(p0 context.Context) error
- func (s *CandidateStub) GetBlocksWithAssetCID(p0 context.Context, p1 string, p2 int64, p3 int) ([]string, error)
- func (s *CandidateStub) GetExternalAddress(p0 context.Context) (string, error)
- func (s *CandidateStub) GetMinioConfig(p0 context.Context) (*types.MinioConfig, error)
- func (s *CandidateStub) WaitQuiet(p0 context.Context) error
- type Common
- type CommonStruct
- func (s *CommonStruct) AuthNew(p0 context.Context, p1 *types.JWTPayload) (string, error)
- func (s *CommonStruct) AuthVerify(p0 context.Context, p1 string) (*types.JWTPayload, error)
- func (s *CommonStruct) Closing(p0 context.Context) (<-chan struct{}, error)
- func (s *CommonStruct) Discover(p0 context.Context) (types.OpenRPCDocument, error)
- func (s *CommonStruct) ExternalServiceAddress(p0 context.Context, p1 string) (string, error)
- func (s *CommonStruct) LogAlerts(p0 context.Context) ([]alerting.Alert, error)
- func (s *CommonStruct) LogList(p0 context.Context) ([]string, error)
- func (s *CommonStruct) LogSetLevel(p0 context.Context, p1 string, p2 string) error
- func (s *CommonStruct) Session(p0 context.Context) (uuid.UUID, error)
- func (s *CommonStruct) Shutdown(p0 context.Context) error
- func (s *CommonStruct) Version(p0 context.Context) (APIVersion, error)
- type CommonStub
- func (s *CommonStub) AuthNew(p0 context.Context, p1 *types.JWTPayload) (string, error)
- func (s *CommonStub) AuthVerify(p0 context.Context, p1 string) (*types.JWTPayload, error)
- func (s *CommonStub) Closing(p0 context.Context) (<-chan struct{}, error)
- func (s *CommonStub) Discover(p0 context.Context) (types.OpenRPCDocument, error)
- func (s *CommonStub) ExternalServiceAddress(p0 context.Context, p1 string) (string, error)
- func (s *CommonStub) LogAlerts(p0 context.Context) ([]alerting.Alert, error)
- func (s *CommonStub) LogList(p0 context.Context) ([]string, error)
- func (s *CommonStub) LogSetLevel(p0 context.Context, p1 string, p2 string) error
- func (s *CommonStub) Session(p0 context.Context) (uuid.UUID, error)
- func (s *CommonStub) Shutdown(p0 context.Context) error
- func (s *CommonStub) Version(p0 context.Context) (APIVersion, error)
- type DataSync
- type DataSyncStruct
- type DataSyncStub
- type Device
- type DeviceStruct
- type DeviceStub
- type Edge
- type EdgeStruct
- func (s *EdgeStruct) CreateTunnel(p0 context.Context, p1 *types.CreateTunnelReq) error
- func (s *EdgeStruct) GetEdgeOnlineStateFromScheduler(p0 context.Context) (bool, error)
- func (s *EdgeStruct) Restart(p0 context.Context) error
- func (s *EdgeStruct) UserNATPunch(p0 context.Context, p1 string, p2 *types.NatPunchReq) error
- func (s *EdgeStruct) WaitQuiet(p0 context.Context) error
- type EdgeStub
- func (s *EdgeStub) CreateTunnel(p0 context.Context, p1 *types.CreateTunnelReq) error
- func (s *EdgeStub) GetEdgeOnlineStateFromScheduler(p0 context.Context) (bool, error)
- func (s *EdgeStub) Restart(p0 context.Context) error
- func (s *EdgeStub) UserNATPunch(p0 context.Context, p1 string, p2 *types.NatPunchReq) error
- func (s *EdgeStub) WaitQuiet(p0 context.Context) error
- type EdgeUpdateConfig
- type ErrNode
- type ErrUnknown
- type ErrWeb
- type L5
- type L5Struct
- type L5Stub
- type Locator
- type LocatorStruct
- func (s *LocatorStruct) AllocateSchedulerForNode(p0 context.Context, p1 types.NodeType, p2 string) (string, error)
- func (s *LocatorStruct) CandidateDownloadInfos(p0 context.Context, p1 string) ([]*types.CandidateDownloadInfo, error)
- func (s *LocatorStruct) EdgeDownloadInfos(p0 context.Context, p1 string) ([]*types.EdgeDownloadInfoList, error)
- func (s *LocatorStruct) GetAccessPoints(p0 context.Context, p1 string, p2 string) ([]string, error)
- func (s *LocatorStruct) GetAccessPointsV2(p0 context.Context, p1 string, p2 string) (*types.AccessPointRsp, error)
- func (s *LocatorStruct) GetAssetSourceDownloadInfos(p0 context.Context, p1 string) ([]*types.AssetSourceDownloadInfoRsp, error)
- func (s *LocatorStruct) GetCandidateIP(p0 context.Context, p1 string) (string, error)
- func (s *LocatorStruct) GetDeploymentCandidateIP(p0 context.Context, p1 string) (string, error)
- func (s *LocatorStruct) GetSchedulerWithNode(p0 context.Context, p1 string) (string, error)
- func (s *LocatorStruct) GetUserAccessPoint(p0 context.Context, p1 string) (*AccessPoint, error)
- type LocatorStub
- func (s *LocatorStub) AllocateSchedulerForNode(p0 context.Context, p1 types.NodeType, p2 string) (string, error)
- func (s *LocatorStub) CandidateDownloadInfos(p0 context.Context, p1 string) ([]*types.CandidateDownloadInfo, error)
- func (s *LocatorStub) EdgeDownloadInfos(p0 context.Context, p1 string) ([]*types.EdgeDownloadInfoList, error)
- func (s *LocatorStub) GetAccessPoints(p0 context.Context, p1 string, p2 string) ([]string, error)
- func (s *LocatorStub) GetAccessPointsV2(p0 context.Context, p1 string, p2 string) (*types.AccessPointRsp, error)
- func (s *LocatorStub) GetAssetSourceDownloadInfos(p0 context.Context, p1 string) ([]*types.AssetSourceDownloadInfoRsp, error)
- func (s *LocatorStub) GetCandidateIP(p0 context.Context, p1 string) (string, error)
- func (s *LocatorStub) GetDeploymentCandidateIP(p0 context.Context, p1 string) (string, error)
- func (s *LocatorStub) GetSchedulerWithNode(p0 context.Context, p1 string) (string, error)
- func (s *LocatorStub) GetUserAccessPoint(p0 context.Context, p1 string) (*AccessPoint, error)
- type LogFile
- type NodeAPI
- type NodeAPIStruct
- func (s *NodeAPIStruct) CalculateDowntimePenalty(p0 context.Context, p1 string) (types.ExitProfitRsp, error)
- func (s *NodeAPIStruct) CalculateExitProfit(p0 context.Context, p1 string) (types.ExitProfitRsp, error)
- func (s *NodeAPIStruct) CandidateConnect(p0 context.Context, p1 *types.ConnectOptions) error
- func (s *NodeAPIStruct) CheckIpUsage(p0 context.Context, p1 string) (bool, error)
- func (s *NodeAPIStruct) CleanupNode(p0 context.Context, p1 string, p2 string) error
- func (s *NodeAPIStruct) CreateTunnel(p0 context.Context, p1 *types.CreateTunnelReq) error
- func (s *NodeAPIStruct) DeactivateNode(p0 context.Context, p1 string, p2 int) error
- func (s *NodeAPIStruct) DeactivateNodeV2(p0 context.Context, p1 string, p2 int, p3 float64) error
- func (s *NodeAPIStruct) DownloadDataResult(p0 context.Context, p1 string, p2 string, p3 int64) error
- func (s *NodeAPIStruct) EdgeConnect(p0 context.Context, p1 *types.ConnectOptions) error
- func (s *NodeAPIStruct) ForceNodeOffline(p0 context.Context, p1 string, p2 bool) error
- func (s *NodeAPIStruct) FreeUpDiskSpace(p0 context.Context, p1 string, p2 int64) (*types.FreeUpDiskResp, error)
- func (s *NodeAPIStruct) GetAssetSourceDownloadInfo(p0 context.Context, p1 string) (*types.AssetSourceDownloadInfoRsp, error)
- func (s *NodeAPIStruct) GetAssetView(p0 context.Context, p1 string, p2 bool) (*types.AssetView, error)
- func (s *NodeAPIStruct) GetAssetsInBucket(p0 context.Context, p1 string, p2 int, p3 bool) ([]string, error)
- func (s *NodeAPIStruct) GetCandidateDownloadInfos(p0 context.Context, p1 string) ([]*types.CandidateDownloadInfo, error)
- func (s *NodeAPIStruct) GetCandidateIPs(p0 context.Context) ([]*types.NodeIPInfo, error)
- func (s *NodeAPIStruct) GetCandidateNodeIP(p0 context.Context, p1 string) (string, error)
- func (s *NodeAPIStruct) GetCandidateURLsForDetectNat(p0 context.Context) ([]string, error)
- func (s *NodeAPIStruct) GetCurrentRegionInfos(p0 context.Context, p1 string) (map[string]int, error)
- func (s *NodeAPIStruct) GetEdgeDownloadInfos(p0 context.Context, p1 string) (*types.EdgeDownloadInfoList, error)
- func (s *NodeAPIStruct) GetEdgeExternalServiceAddress(p0 context.Context, p1 string, p2 string) (string, error)
- func (s *NodeAPIStruct) GetExternalAddress(p0 context.Context) (string, error)
- func (s *NodeAPIStruct) GetMinioConfigFromCandidate(p0 context.Context, p1 string) (*types.MinioConfig, error)
- func (s *NodeAPIStruct) GetNextFreeTime(p0 context.Context, p1 string) (int64, error)
- func (s *NodeAPIStruct) GetNodeInfo(p0 context.Context, p1 string) (*types.NodeInfo, error)
- func (s *NodeAPIStruct) GetNodeList(p0 context.Context, p1 int, p2 int) (*types.ListNodesRsp, error)
- func (s *NodeAPIStruct) GetNodeOfIP(p0 context.Context, p1 string) ([]string, error)
- func (s *NodeAPIStruct) GetNodeOnlineState(p0 context.Context) (bool, error)
- func (s *NodeAPIStruct) GetNodeToken(p0 context.Context, p1 string) (string, error)
- func (s *NodeAPIStruct) GetNodesFromRegion(p0 context.Context, p1 string) ([]*types.NodeInfo, error)
- func (s *NodeAPIStruct) GetOnlineNodeCount(p0 context.Context, p1 types.NodeType) (int, error)
- func (s *NodeAPIStruct) GetProfitDetailsForNode(p0 context.Context, p1 string, p2 int, p3 int, p4 []int) (*types.ListNodeProfitDetailsRsp, error)
- func (s *NodeAPIStruct) GetTunserverURLFromUser(p0 context.Context, p1 *types.TunserverReq) (*types.TunserverRsp, error)
- func (s *NodeAPIStruct) L3Connect(p0 context.Context, p1 *types.ConnectOptions) error
- func (s *NodeAPIStruct) L5Connect(p0 context.Context, p1 *types.ConnectOptions) error
- func (s *NodeAPIStruct) LoadNodeBandwidthScores(p0 context.Context, p1 string, p2 time.Time, p3 time.Time, p4 int, p5 int) (*types.ListBandwidthScoreRsp, error)
- func (s *NodeAPIStruct) MigrateNodeIn(p0 context.Context, p1 *types.NodeMigrateInfo) error
- func (s *NodeAPIStruct) MigrateNodeOut(p0 context.Context, p1 string) (*types.NodeMigrateInfo, error)
- func (s *NodeAPIStruct) NatPunch(p0 context.Context, p1 *types.NatPunchReq) error
- func (s *NodeAPIStruct) NodeExists(p0 context.Context, p1 string) error
- func (s *NodeAPIStruct) NodeKeepalive(p0 context.Context) (*types.KeepaliveRsp, error)
- func (s *NodeAPIStruct) NodeKeepaliveV2(p0 context.Context) (uuid.UUID, error)
- func (s *NodeAPIStruct) NodeKeepaliveV3(p0 context.Context, p1 *types.KeepaliveReq) (*types.KeepaliveRsp, error)
- func (s *NodeAPIStruct) NodeLogin(p0 context.Context, p1 string, p2 string) (string, error)
- func (s *NodeAPIStruct) PerformSyncData(p0 context.Context, p1 string) error
- func (s *NodeAPIStruct) ReDetermineNodeNATType(p0 context.Context, p1 string) error
- func (s *NodeAPIStruct) RecompenseNodeProfit(p0 context.Context, p1 string, p2 string, p3 float64) error
- func (s *NodeAPIStruct) RegisterCandidateNode(p0 context.Context, p1 string, p2 string, p3 string) (*types.ActivationDetail, error)
- func (s *NodeAPIStruct) RegisterEdgeNode(p0 context.Context, p1 string, p2 string) (*types.ActivationDetail, error)
- func (s *NodeAPIStruct) RegisterNode(p0 context.Context, p1 string, p2 string, p3 types.NodeType) (*types.ActivationDetail, error)
- func (s *NodeAPIStruct) RegisterNodeV2(p0 context.Context, p1 types.NodeRegister) (*types.ActivationDetail, error)
- func (s *NodeAPIStruct) RequestActivationCodes(p0 context.Context, p1 types.NodeType, p2 int) ([]*types.NodeActivation, error)
- func (s *NodeAPIStruct) SetTunserverURL(p0 context.Context, p1 string, p2 string) error
- func (s *NodeAPIStruct) UndoNodeDeactivation(p0 context.Context, p1 string) error
- func (s *NodeAPIStruct) UpdateBandwidths(p0 context.Context, p1 int64, p2 int64) error
- func (s *NodeAPIStruct) UpdateNodePort(p0 context.Context, p1 string, p2 string) error
- func (s *NodeAPIStruct) UserAssetDownloadResultV2(p0 context.Context, p1 *types.RetrieveEvent) error
- func (s *NodeAPIStruct) VerifyTokenWithLimitCount(p0 context.Context, p1 string) (*types.JWTPayload, error)
- type NodeAPIStub
- func (s *NodeAPIStub) CalculateDowntimePenalty(p0 context.Context, p1 string) (types.ExitProfitRsp, error)
- func (s *NodeAPIStub) CalculateExitProfit(p0 context.Context, p1 string) (types.ExitProfitRsp, error)
- func (s *NodeAPIStub) CandidateConnect(p0 context.Context, p1 *types.ConnectOptions) error
- func (s *NodeAPIStub) CheckIpUsage(p0 context.Context, p1 string) (bool, error)
- func (s *NodeAPIStub) CleanupNode(p0 context.Context, p1 string, p2 string) error
- func (s *NodeAPIStub) CreateTunnel(p0 context.Context, p1 *types.CreateTunnelReq) error
- func (s *NodeAPIStub) DeactivateNode(p0 context.Context, p1 string, p2 int) error
- func (s *NodeAPIStub) DeactivateNodeV2(p0 context.Context, p1 string, p2 int, p3 float64) error
- func (s *NodeAPIStub) DownloadDataResult(p0 context.Context, p1 string, p2 string, p3 int64) error
- func (s *NodeAPIStub) EdgeConnect(p0 context.Context, p1 *types.ConnectOptions) error
- func (s *NodeAPIStub) ForceNodeOffline(p0 context.Context, p1 string, p2 bool) error
- func (s *NodeAPIStub) FreeUpDiskSpace(p0 context.Context, p1 string, p2 int64) (*types.FreeUpDiskResp, error)
- func (s *NodeAPIStub) GetAssetSourceDownloadInfo(p0 context.Context, p1 string) (*types.AssetSourceDownloadInfoRsp, error)
- func (s *NodeAPIStub) GetAssetView(p0 context.Context, p1 string, p2 bool) (*types.AssetView, error)
- func (s *NodeAPIStub) GetAssetsInBucket(p0 context.Context, p1 string, p2 int, p3 bool) ([]string, error)
- func (s *NodeAPIStub) GetCandidateDownloadInfos(p0 context.Context, p1 string) ([]*types.CandidateDownloadInfo, error)
- func (s *NodeAPIStub) GetCandidateIPs(p0 context.Context) ([]*types.NodeIPInfo, error)
- func (s *NodeAPIStub) GetCandidateNodeIP(p0 context.Context, p1 string) (string, error)
- func (s *NodeAPIStub) GetCandidateURLsForDetectNat(p0 context.Context) ([]string, error)
- func (s *NodeAPIStub) GetCurrentRegionInfos(p0 context.Context, p1 string) (map[string]int, error)
- func (s *NodeAPIStub) GetEdgeDownloadInfos(p0 context.Context, p1 string) (*types.EdgeDownloadInfoList, error)
- func (s *NodeAPIStub) GetEdgeExternalServiceAddress(p0 context.Context, p1 string, p2 string) (string, error)
- func (s *NodeAPIStub) GetExternalAddress(p0 context.Context) (string, error)
- func (s *NodeAPIStub) GetMinioConfigFromCandidate(p0 context.Context, p1 string) (*types.MinioConfig, error)
- func (s *NodeAPIStub) GetNextFreeTime(p0 context.Context, p1 string) (int64, error)
- func (s *NodeAPIStub) GetNodeInfo(p0 context.Context, p1 string) (*types.NodeInfo, error)
- func (s *NodeAPIStub) GetNodeList(p0 context.Context, p1 int, p2 int) (*types.ListNodesRsp, error)
- func (s *NodeAPIStub) GetNodeOfIP(p0 context.Context, p1 string) ([]string, error)
- func (s *NodeAPIStub) GetNodeOnlineState(p0 context.Context) (bool, error)
- func (s *NodeAPIStub) GetNodeToken(p0 context.Context, p1 string) (string, error)
- func (s *NodeAPIStub) GetNodesFromRegion(p0 context.Context, p1 string) ([]*types.NodeInfo, error)
- func (s *NodeAPIStub) GetOnlineNodeCount(p0 context.Context, p1 types.NodeType) (int, error)
- func (s *NodeAPIStub) GetProfitDetailsForNode(p0 context.Context, p1 string, p2 int, p3 int, p4 []int) (*types.ListNodeProfitDetailsRsp, error)
- func (s *NodeAPIStub) GetTunserverURLFromUser(p0 context.Context, p1 *types.TunserverReq) (*types.TunserverRsp, error)
- func (s *NodeAPIStub) L3Connect(p0 context.Context, p1 *types.ConnectOptions) error
- func (s *NodeAPIStub) L5Connect(p0 context.Context, p1 *types.ConnectOptions) error
- func (s *NodeAPIStub) LoadNodeBandwidthScores(p0 context.Context, p1 string, p2 time.Time, p3 time.Time, p4 int, p5 int) (*types.ListBandwidthScoreRsp, error)
- func (s *NodeAPIStub) MigrateNodeIn(p0 context.Context, p1 *types.NodeMigrateInfo) error
- func (s *NodeAPIStub) MigrateNodeOut(p0 context.Context, p1 string) (*types.NodeMigrateInfo, error)
- func (s *NodeAPIStub) NatPunch(p0 context.Context, p1 *types.NatPunchReq) error
- func (s *NodeAPIStub) NodeExists(p0 context.Context, p1 string) error
- func (s *NodeAPIStub) NodeKeepalive(p0 context.Context) (*types.KeepaliveRsp, error)
- func (s *NodeAPIStub) NodeKeepaliveV2(p0 context.Context) (uuid.UUID, error)
- func (s *NodeAPIStub) NodeKeepaliveV3(p0 context.Context, p1 *types.KeepaliveReq) (*types.KeepaliveRsp, error)
- func (s *NodeAPIStub) NodeLogin(p0 context.Context, p1 string, p2 string) (string, error)
- func (s *NodeAPIStub) PerformSyncData(p0 context.Context, p1 string) error
- func (s *NodeAPIStub) ReDetermineNodeNATType(p0 context.Context, p1 string) error
- func (s *NodeAPIStub) RecompenseNodeProfit(p0 context.Context, p1 string, p2 string, p3 float64) error
- func (s *NodeAPIStub) RegisterCandidateNode(p0 context.Context, p1 string, p2 string, p3 string) (*types.ActivationDetail, error)
- func (s *NodeAPIStub) RegisterEdgeNode(p0 context.Context, p1 string, p2 string) (*types.ActivationDetail, error)
- func (s *NodeAPIStub) RegisterNode(p0 context.Context, p1 string, p2 string, p3 types.NodeType) (*types.ActivationDetail, error)
- func (s *NodeAPIStub) RegisterNodeV2(p0 context.Context, p1 types.NodeRegister) (*types.ActivationDetail, error)
- func (s *NodeAPIStub) RequestActivationCodes(p0 context.Context, p1 types.NodeType, p2 int) ([]*types.NodeActivation, error)
- func (s *NodeAPIStub) SetTunserverURL(p0 context.Context, p1 string, p2 string) error
- func (s *NodeAPIStub) UndoNodeDeactivation(p0 context.Context, p1 string) error
- func (s *NodeAPIStub) UpdateBandwidths(p0 context.Context, p1 int64, p2 int64) error
- func (s *NodeAPIStub) UpdateNodePort(p0 context.Context, p1 string, p2 string) error
- func (s *NodeAPIStub) UserAssetDownloadResultV2(p0 context.Context, p1 *types.RetrieveEvent) error
- func (s *NodeAPIStub) VerifyTokenWithLimitCount(p0 context.Context, p1 string) (*types.JWTPayload, error)
- type ProjectAPI
- type ProjectAPIStruct
- func (s *ProjectAPIStruct) DeleteProject(p0 context.Context, p1 *types.ProjectReq) error
- func (s *ProjectAPIStruct) DeployProject(p0 context.Context, p1 *types.DeployProjectReq) error
- func (s *ProjectAPIStruct) GetProjectInfo(p0 context.Context, p1 string) (*types.ProjectInfo, error)
- func (s *ProjectAPIStruct) GetProjectInfos(p0 context.Context, p1 string, p2 int, p3 int) ([]*types.ProjectInfo, error)
- func (s *ProjectAPIStruct) GetProjectOverviewByNode(p0 context.Context, p1 *types.NodeProjectReq) (*types.ListProjectOverviewRsp, error)
- func (s *ProjectAPIStruct) GetProjectReplicasForNode(p0 context.Context, p1 *types.NodeProjectReq) (*types.ListProjectReplicaRsp, error)
- func (s *ProjectAPIStruct) GetProjectsForNode(p0 context.Context, p1 string) ([]*types.ProjectReplicas, error)
- func (s *ProjectAPIStruct) RedeployFailedProjects(p0 context.Context, p1 []string) error
- func (s *ProjectAPIStruct) UpdateProject(p0 context.Context, p1 *types.ProjectReq) error
- func (s *ProjectAPIStruct) UpdateProjectStatus(p0 context.Context, p1 []*types.Project) error
- type ProjectAPIStub
- func (s *ProjectAPIStub) DeleteProject(p0 context.Context, p1 *types.ProjectReq) error
- func (s *ProjectAPIStub) DeployProject(p0 context.Context, p1 *types.DeployProjectReq) error
- func (s *ProjectAPIStub) GetProjectInfo(p0 context.Context, p1 string) (*types.ProjectInfo, error)
- func (s *ProjectAPIStub) GetProjectInfos(p0 context.Context, p1 string, p2 int, p3 int) ([]*types.ProjectInfo, error)
- func (s *ProjectAPIStub) GetProjectOverviewByNode(p0 context.Context, p1 *types.NodeProjectReq) (*types.ListProjectOverviewRsp, error)
- func (s *ProjectAPIStub) GetProjectReplicasForNode(p0 context.Context, p1 *types.NodeProjectReq) (*types.ListProjectReplicaRsp, error)
- func (s *ProjectAPIStub) GetProjectsForNode(p0 context.Context, p1 string) ([]*types.ProjectReplicas, error)
- func (s *ProjectAPIStub) RedeployFailedProjects(p0 context.Context, p1 []string) error
- func (s *ProjectAPIStub) UpdateProject(p0 context.Context, p1 *types.ProjectReq) error
- func (s *ProjectAPIStub) UpdateProjectStatus(p0 context.Context, p1 []*types.Project) error
- type Scheduler
- type SchedulerStruct
- func (s *SchedulerStruct) AddNodeServiceEvent(p0 context.Context, p1 *types.ServiceEvent) error
- func (s *SchedulerStruct) AssignTunserverURL(p0 context.Context) (*types.TunserverRsp, error)
- func (s *SchedulerStruct) CandidateCodeExist(p0 context.Context, p1 string) (bool, error)
- func (s *SchedulerStruct) DeleteEdgeUpdateConfig(p0 context.Context, p1 int) error
- func (s *SchedulerStruct) GenerateCandidateCodes(p0 context.Context, p1 int, p2 types.NodeType, p3 bool) ([]string, error)
- func (s *SchedulerStruct) GetCandidateCodeInfos(p0 context.Context, p1 string, p2 string) ([]*types.CandidateCodeInfo, error)
- func (s *SchedulerStruct) GetDeploymentProviderIP(p0 context.Context, p1 types.DeploymentID) (string, error)
- func (s *SchedulerStruct) GetEdgeUpdateConfigs(p0 context.Context) (map[int]*EdgeUpdateConfig, error)
- func (s *SchedulerStruct) GetNodePublicKey(p0 context.Context, p1 string) (string, error)
- func (s *SchedulerStruct) GetNodeUploadInfo(p0 context.Context, p1 string, p2 string, p3 bool) (*types.UploadInfo, error)
- func (s *SchedulerStruct) GetNodeUploadInfoV2(p0 context.Context, p1 *types.GetUploadInfoReq) (*types.UploadInfo, error)
- func (s *SchedulerStruct) GetReplicaEvents(p0 context.Context, p1 time.Time, p2 time.Time, p3 int, p4 int) (*types.ListAssetReplicaEventRsp, error)
- func (s *SchedulerStruct) GetSchedulerPublicKey(p0 context.Context) (string, error)
- func (s *SchedulerStruct) GetValidationResults(p0 context.Context, p1 string, p2 int, p3 int) (*types.ListValidationResultRsp, error)
- func (s *SchedulerStruct) GetValidators(p0 context.Context) ([]string, error)
- func (s *SchedulerStruct) GetWorkloadRecord(p0 context.Context, p1 string) (*types.WorkloadRecord, error)
- func (s *SchedulerStruct) GetWorkloadRecords(p0 context.Context, p1 string, p2 int, p3 int) (*types.ListWorkloadRecordRsp, error)
- func (s *SchedulerStruct) NodeValidationResult(p0 context.Context, p1 io.Reader, p2 string) error
- func (s *SchedulerStruct) RemoveCandidateCode(p0 context.Context, p1 string) error
- func (s *SchedulerStruct) ResetCandidateCode(p0 context.Context, p1 string, p2 string) error
- func (s *SchedulerStruct) SetEdgeUpdateConfig(p0 context.Context, p1 *EdgeUpdateConfig) error
- func (s *SchedulerStruct) SubmitProjectReport(p0 context.Context, p1 *types.ProjectRecordReq) error
- func (s *SchedulerStruct) SubmitWorkloadReport(p0 context.Context, p1 *types.WorkloadRecordReq) error
- func (s *SchedulerStruct) SubmitWorkloadReportV2(p0 context.Context, p1 *types.WorkloadRecordReq) error
- func (s *SchedulerStruct) UserAssetDownloadResult(p0 context.Context, p1 string, p2 string, p3 int64, p4 int64) error
- type SchedulerStub
- func (s *SchedulerStub) AddNodeServiceEvent(p0 context.Context, p1 *types.ServiceEvent) error
- func (s *SchedulerStub) AssignTunserverURL(p0 context.Context) (*types.TunserverRsp, error)
- func (s *SchedulerStub) CandidateCodeExist(p0 context.Context, p1 string) (bool, error)
- func (s *SchedulerStub) DeleteEdgeUpdateConfig(p0 context.Context, p1 int) error
- func (s *SchedulerStub) GenerateCandidateCodes(p0 context.Context, p1 int, p2 types.NodeType, p3 bool) ([]string, error)
- func (s *SchedulerStub) GetCandidateCodeInfos(p0 context.Context, p1 string, p2 string) ([]*types.CandidateCodeInfo, error)
- func (s *SchedulerStub) GetDeploymentProviderIP(p0 context.Context, p1 types.DeploymentID) (string, error)
- func (s *SchedulerStub) GetEdgeUpdateConfigs(p0 context.Context) (map[int]*EdgeUpdateConfig, error)
- func (s *SchedulerStub) GetNodePublicKey(p0 context.Context, p1 string) (string, error)
- func (s *SchedulerStub) GetNodeUploadInfo(p0 context.Context, p1 string, p2 string, p3 bool) (*types.UploadInfo, error)
- func (s *SchedulerStub) GetNodeUploadInfoV2(p0 context.Context, p1 *types.GetUploadInfoReq) (*types.UploadInfo, error)
- func (s *SchedulerStub) GetReplicaEvents(p0 context.Context, p1 time.Time, p2 time.Time, p3 int, p4 int) (*types.ListAssetReplicaEventRsp, error)
- func (s *SchedulerStub) GetSchedulerPublicKey(p0 context.Context) (string, error)
- func (s *SchedulerStub) GetValidationResults(p0 context.Context, p1 string, p2 int, p3 int) (*types.ListValidationResultRsp, error)
- func (s *SchedulerStub) GetValidators(p0 context.Context) ([]string, error)
- func (s *SchedulerStub) GetWorkloadRecord(p0 context.Context, p1 string) (*types.WorkloadRecord, error)
- func (s *SchedulerStub) GetWorkloadRecords(p0 context.Context, p1 string, p2 int, p3 int) (*types.ListWorkloadRecordRsp, error)
- func (s *SchedulerStub) NodeValidationResult(p0 context.Context, p1 io.Reader, p2 string) error
- func (s *SchedulerStub) RemoveCandidateCode(p0 context.Context, p1 string) error
- func (s *SchedulerStub) ResetCandidateCode(p0 context.Context, p1 string, p2 string) error
- func (s *SchedulerStub) SetEdgeUpdateConfig(p0 context.Context, p1 *EdgeUpdateConfig) error
- func (s *SchedulerStub) SubmitProjectReport(p0 context.Context, p1 *types.ProjectRecordReq) error
- func (s *SchedulerStub) SubmitWorkloadReport(p0 context.Context, p1 *types.WorkloadRecordReq) error
- func (s *SchedulerStub) SubmitWorkloadReportV2(p0 context.Context, p1 *types.WorkloadRecordReq) error
- func (s *SchedulerStub) UserAssetDownloadResult(p0 context.Context, p1 string, p2 string, p3 int64, p4 int64) error
- type TCPMsgType
- type ValidateReq
- type Validation
- type ValidationResult
- type ValidationStruct
- type ValidationStub
- type Version
- type Workerd
- type WorkerdStruct
- func (s *WorkerdStruct) Delete(p0 context.Context, p1 string) error
- func (s *WorkerdStruct) Deploy(p0 context.Context, p1 *types.Project) error
- func (s *WorkerdStruct) Query(p0 context.Context, p1 []string) ([]*types.Project, error)
- func (s *WorkerdStruct) Update(p0 context.Context, p1 *types.Project) error
- type WorkerdStub
- func (s *WorkerdStub) Delete(p0 context.Context, p1 string) error
- func (s *WorkerdStub) Deploy(p0 context.Context, p1 *types.Project) error
- func (s *WorkerdStub) Query(p0 context.Context, p1 []string) ([]*types.Project, error)
- func (s *WorkerdStub) Update(p0 context.Context, p1 *types.Project) error
Constants ¶
const ( EUnknown = iota + jsonrpc.FirstUserCode EWeb )
const ( RoleWeb auth.Permission = "web" RoleCandidate auth.Permission = "candidate" RoleEdge auth.Permission = "edge" RoleLocator auth.Permission = "locator" RoleAdmin auth.Permission = "admin" // Manage permissions RoleDefault auth.Permission = "default" RoleUser auth.Permission = "user" RoleL5 auth.Permission = "l5" )
Variables ¶
var ( SchedulerAPIVersion0 = newVer(1, 0, 0) CandidateAPIVersion0 = newVer(1, 0, 0) EdgeAPIVersion0 = newVer(1, 0, 0) LocationAPIVersion0 = newVer(1, 0, 0) )
semver versions of the rpc api exposed
var AllPermissions = []auth.Permission{RoleWeb, RoleCandidate, RoleEdge, RoleLocator, RoleAdmin, RoleDefault, RoleUser, RoleL5}
var ErrNotSupported = xerrors.New("method not supported")
var RPCErrors = jsonrpc.NewErrors()
Functions ¶
func AllowUserAccess ¶ added in v0.1.11
func GetInternalStructs ¶
func GetInternalStructs(in interface{}) []interface{}
GetInternalStructs extracts all pointers to 'Internal' sub-structs from the provided pointer to a proxy struct
func HasPerm ¶
func HasPerm(ctx context.Context, defaultPerm auth.Permission, perms auth.Permission) bool
func PermissionedProxy ¶
func PermissionedProxy(validPerms []auth.Permission, defaultPerms auth.Permission, in interface{}, out interface{})
func WithUserAccessControl ¶ added in v0.1.11
Types ¶
type APIVersion ¶
type APIVersion struct {
Version string
// APIVersion is a binary encoded semver version of the remote implementing
// this api
//
// See APIVersion in build/version.go
APIVersion Version
// Seconds
BlockDelay uint64
}
APIVersion provides various build-time information
func (APIVersion) String ¶
func (v APIVersion) String() string
type AccessPoint ¶
AccessPoint represents an access point within an area, containing scheduler information.
type Asset ¶
type Asset interface {
// PullAsset pull the asset with given assetCID from specified sources
PullAsset(ctx context.Context, assetCID string, sources []*types.CandidateDownloadInfo) error //perm:admin
// PullAssetV2 pull the asset by scheduler
PullAssetV2(ctx context.Context, req *types.AssetPullRequest) error //perm:admin
// DeleteAsset deletes the asset with given assetCID
DeleteAsset(ctx context.Context, assetCID string) error //perm:admin
// GetAssetStats retrieves the statistics of assets
GetAssetStats(ctx context.Context) (*types.AssetStats, error) //perm:admin
// GetCachingAssetInfo retrieves the information of assets that are currently being pulled
GetPullingAssetInfo(ctx context.Context) (*types.InProgressAsset, error) //perm:admin
// GetAssetProgresses retrieves the progress of assets with specified assetCIDs
GetAssetProgresses(ctx context.Context, assetCIDs []string) (*types.PullResult, error) //perm:admin
// CreateAsset notify candidate that user upload asset, return auth token of candidate
CreateAsset(ctx context.Context, tokenPayload *types.AuthUserUploadDownloadAsset) (string, error) //perm:admin
// PullAssetWithURL download the file locally from the url and save it as car file
PullAssetFromAWS(ctx context.Context, bucket, key string) error //perm:admin
// GetAssetView get asset view
GetAssetView(ctx context.Context) (*types.AssetView, error) //perm:admin
// AddAssetView add asset to view
AddAssetView(ctx context.Context, assetCIDs []string) error //perm:admin
// GetAssetsInBucket get assets in bucket
GetAssetsInBucket(ctx context.Context, bucketID int) ([]string, error) //perm:admin
// SyncAssetViewAndData sync assetView and local car
SyncAssetViewAndData(ctx context.Context) error //perm:admin
// RequestFreeUpDisk Initiate a request to free up disk space with a certain size, size unit GiB
RequestFreeUpDisk(ctx context.Context, size float64) error //perm:admin
// StateFreeUpDisk shows the result of last free task is done, return nil means done
StateFreeUpDisk(ctx context.Context) (*types.FreeUpDiskStateResp, error) //perm:admin
// ClearFreeUpDisk clear the previous failed task
ClearFreeUpDisk(ctx context.Context) error //perm:admin
}
Asset is an interface for asset manager
type AssetAPI ¶ added in v0.1.10
type AssetAPI interface {
// Asset-related methods
// PullAsset Pull an asset based on the provided PullAssetReq structure.
PullAsset(ctx context.Context, info *types.PullAssetReq) error //perm:web,admin
// RemoveAssetRecord removes the asset record with the specified CID from the scheduler
RemoveAssetRecord(ctx context.Context, cid string) error //perm:admin,web
// RemoveAssetRecords removes the asset record with the specified CID from the scheduler
RemoveAssetRecords(ctx context.Context, cids []string) error //perm:admin,web
// StopAssetRecord stop asset
StopAssetRecord(ctx context.Context, cids []string) error //perm:admin
// RemoveAssetReplica deletes an asset replica with the specified CID and node from the scheduler
RemoveAssetReplica(ctx context.Context, cid, nodeID string) error //perm:admin
// GetAssetRecord retrieves the asset record with the specified CID
GetAssetRecord(ctx context.Context, cid string) (*types.AssetRecord, error) //perm:web,admin
// GetAssetRecords retrieves a list of asset records with pagination using the specified limit, offset, and states
GetAssetRecords(ctx context.Context, limit, offset int, states []string, serverID dtypes.ServerID) ([]*types.AssetRecord, error) //perm:web,admin
// GetAssetRecordsWithCIDs retrieves a list of asset records with cid
GetAssetRecordsWithCIDs(ctx context.Context, cids []string) ([]*types.AssetRecord, error) //perm:web,admin
// GetReplicas retrieves a list of asset replicas with pagination using the specified limit, offset
GetReplicas(ctx context.Context, cid string, limit, offset int) (*types.ListReplicaRsp, error) //perm:web,admin
// RePullFailedAssets retries the pull process for a list of failed assets
RePullFailedAssets(ctx context.Context, hashes []types.AssetHash) error //perm:admin
// UpdateAssetExpiration updates the expiration time for an asset with the specified CID
UpdateAssetExpiration(ctx context.Context, cid string, time time.Time) error //perm:web,admin
// ResetAssetReplicaCount updates the replica count for an asset with the specified CID
ResetAssetReplicaCount(ctx context.Context, cid string, count int) error //perm:web,admin
// NodeRemoveAssetResult the result of an asset removal operation
NodeRemoveAssetResult(ctx context.Context, resultInfo types.RemoveAssetResult) error //perm:edge,candidate
// GetAssetListForBucket retrieves a list of asset hashes for a bucket associated with the specified bucket ID (bucketID is hash code)
GetAssetListForBucket(ctx context.Context, bucketID uint32) ([]string, error) //perm:edge,candidate
// GetAssetCount retrieves a count of asset
GetAssetCount(ctx context.Context) (int, error) //perm:web,admin
// GetAssetsForNode retrieves a asset list of node
GetAssetsForNode(ctx context.Context, nodeID string, limit, offset int) (*types.ListNodeAssetRsp, error) //perm:web,admin
// GetReplicasForNode retrieves a replica list of node
GetReplicasForNode(ctx context.Context, nodeID string, limit, offset int, statuses []types.ReplicaStatus) (*types.ListNodeReplicaRsp, error) //perm:web,admin
// GetReplicaEventsForNode retrieves a replica event list of node
GetReplicaEventsForNode(ctx context.Context, nodeID string, limit, offset int) (*types.ListAssetReplicaEventRsp, error) //perm:web,admin
// GetAssetDownloadResults retrieves a asset download list
GetAssetDownloadResults(ctx context.Context, hash string, start, end time.Time) (*types.ListAssetDownloadRsp, error) //perm:web,admin
// GetDownloadResultsFromAssets
GetDownloadResultsFromAssets(ctx context.Context, hashes []string, start, end time.Time) ([]*types.AssetDownloadResultRsp, error) //perm:web,admin
// CreateAsset creates an asset with car CID, car name, and car size.
CreateAsset(ctx context.Context, req *types.CreateAssetReq) (*types.UploadInfo, error) //perm:web,admin,user
// CreateSyncAsset Synchronizing assets from other schedulers
CreateSyncAsset(ctx context.Context, req *types.CreateSyncAssetReq) error //perm:web,admin,user
// GenerateTokenForDownloadSource Generate Token For Download Source
GenerateTokenForDownloadSource(ctx context.Context, nodeID string, cid string) (*types.SourceDownloadInfo, error) //perm:web,admin,user
// GenerateTokenForDownloadSources Generate Token For Download Source
GenerateTokenForDownloadSources(ctx context.Context, cid string) ([]*types.SourceDownloadInfo, error) //perm:web,admin,user
// ShareAssets(ctx context.Context, userID string, assetCID []string, expireTime time.Time) (map[string][]string, error) //perm:web,admin,user
// ShareEncryptedAsset shares the encrypted file
// ShareEncryptedAsset(ctx context.Context, userID, assetCID, filePass string, expireTime time.Time) ([]string, error) // perm:web,admin,user
// ShareAssetV2 shares the assets of the user.
ShareAssetV2(ctx context.Context, info *types.ShareAssetReq) (*types.ShareAssetRsp, error) //perm:web,admin,user
// MinioUploadFileEvent the event of minio upload file
MinioUploadFileEvent(ctx context.Context, event *types.MinioUploadFileEvent) error //perm:candidate
// AddAWSData add aws resource information
AddAWSData(ctx context.Context, list []types.AWSDataInfo) error //perm:web,admin
// SwitchFillDiskTimer switches the timer between ON and OFF states
SwitchFillDiskTimer(ctx context.Context, open bool) error //perm:web,admin
// LoadAWSData load data
LoadAWSData(ctx context.Context, limit, offset int, isDistribute bool) ([]*types.AWSDataInfo, error) //perm:web,admin
// RemoveNodeFailedReplica
RemoveNodeFailedReplica(ctx context.Context) error //perm:web,admin
// GetActiveAssetRecords
GetActiveAssetRecords(ctx context.Context, offset int, limit int) (*types.ListAssetRecordRsp, error) //perm:web,admin
// GetAssetRecordsByDateRange
GetAssetRecordsByDateRange(ctx context.Context, offset int, limit int, start time.Time, end time.Time) (*types.ListAssetRecordRsp, error) //perm:web,admin
// GetSucceededReplicaByCID
GetSucceededReplicaByCID(ctx context.Context, cid string, limit, offset int) (*types.ListReplicaRsp, error) //perm:web,admin
// GetFailedReplicaByCID
GetFailedReplicaByCID(ctx context.Context, cid string, limit, offset int) (*types.ListAssetReplicaEventRsp, error) //perm:web,admin
// GetSucceededReplicaByNode
GetSucceededReplicaByNode(ctx context.Context, nodeID string, limit, offset int) (*types.ListReplicaRsp, error) //perm:web,admin
// GetFailedReplicaByNode
GetFailedReplicaByNode(ctx context.Context, nodeID string, limit, offset int) (*types.ListAssetReplicaEventRsp, error) //perm:web,admin
// GetNodeAssetReplicasByHashes
GetNodeAssetReplicasByHashes(ctx context.Context, nodeID string, hashes []string) ([]*types.ReplicaInfo, error) //perm:web,admin
}
AssetAPI is an interface for asset
type AssetAPIStruct ¶ added in v0.1.10
type AssetAPIStruct struct {
Internal struct {
AddAWSData func(p0 context.Context, p1 []types.AWSDataInfo) error `perm:"web,admin"`
CreateAsset func(p0 context.Context, p1 *types.CreateAssetReq) (*types.UploadInfo, error) `perm:"web,admin,user"`
CreateSyncAsset func(p0 context.Context, p1 *types.CreateSyncAssetReq) error `perm:"web,admin,user"`
GenerateTokenForDownloadSource func(p0 context.Context, p1 string, p2 string) (*types.SourceDownloadInfo, error) `perm:"web,admin,user"`
GenerateTokenForDownloadSources func(p0 context.Context, p1 string) ([]*types.SourceDownloadInfo, error) `perm:"web,admin,user"`
GetActiveAssetRecords func(p0 context.Context, p1 int, p2 int) (*types.ListAssetRecordRsp, error) `perm:"web,admin"`
GetAssetCount func(p0 context.Context) (int, error) `perm:"web,admin"`
GetAssetDownloadResults func(p0 context.Context, p1 string, p2 time.Time, p3 time.Time) (*types.ListAssetDownloadRsp, error) `perm:"web,admin"`
GetAssetListForBucket func(p0 context.Context, p1 uint32) ([]string, error) `perm:"edge,candidate"`
GetAssetRecord func(p0 context.Context, p1 string) (*types.AssetRecord, error) `perm:"web,admin"`
GetAssetRecords func(p0 context.Context, p1 int, p2 int, p3 []string, p4 dtypes.ServerID) ([]*types.AssetRecord, error) `perm:"web,admin"`
GetAssetRecordsByDateRange func(p0 context.Context, p1 int, p2 int, p3 time.Time, p4 time.Time) (*types.ListAssetRecordRsp, error) `perm:"web,admin"`
GetAssetRecordsWithCIDs func(p0 context.Context, p1 []string) ([]*types.AssetRecord, error) `perm:"web,admin"`
GetAssetsForNode func(p0 context.Context, p1 string, p2 int, p3 int) (*types.ListNodeAssetRsp, error) `perm:"web,admin"`
GetDownloadResultsFromAssets func(p0 context.Context, p1 []string, p2 time.Time, p3 time.Time) ([]*types.AssetDownloadResultRsp, error) `perm:"web,admin"`
GetFailedReplicaByCID func(p0 context.Context, p1 string, p2 int, p3 int) (*types.ListAssetReplicaEventRsp, error) `perm:"web,admin"`
GetFailedReplicaByNode func(p0 context.Context, p1 string, p2 int, p3 int) (*types.ListAssetReplicaEventRsp, error) `perm:"web,admin"`
GetNodeAssetReplicasByHashes func(p0 context.Context, p1 string, p2 []string) ([]*types.ReplicaInfo, error) `perm:"web,admin"`
GetReplicaEventsForNode func(p0 context.Context, p1 string, p2 int, p3 int) (*types.ListAssetReplicaEventRsp, error) `perm:"web,admin"`
GetReplicas func(p0 context.Context, p1 string, p2 int, p3 int) (*types.ListReplicaRsp, error) `perm:"web,admin"`
GetReplicasForNode func(p0 context.Context, p1 string, p2 int, p3 int, p4 []types.ReplicaStatus) (*types.ListNodeReplicaRsp, error) `perm:"web,admin"`
GetSucceededReplicaByCID func(p0 context.Context, p1 string, p2 int, p3 int) (*types.ListReplicaRsp, error) `perm:"web,admin"`
GetSucceededReplicaByNode func(p0 context.Context, p1 string, p2 int, p3 int) (*types.ListReplicaRsp, error) `perm:"web,admin"`
LoadAWSData func(p0 context.Context, p1 int, p2 int, p3 bool) ([]*types.AWSDataInfo, error) `perm:"web,admin"`
MinioUploadFileEvent func(p0 context.Context, p1 *types.MinioUploadFileEvent) error `perm:"candidate"`
NodeRemoveAssetResult func(p0 context.Context, p1 types.RemoveAssetResult) error `perm:"edge,candidate"`
PullAsset func(p0 context.Context, p1 *types.PullAssetReq) error `perm:"web,admin"`
RePullFailedAssets func(p0 context.Context, p1 []types.AssetHash) error `perm:"admin"`
RemoveAssetRecord func(p0 context.Context, p1 string) error `perm:"admin,web"`
RemoveAssetRecords func(p0 context.Context, p1 []string) error `perm:"admin,web"`
RemoveAssetReplica func(p0 context.Context, p1 string, p2 string) error `perm:"admin"`
RemoveNodeFailedReplica func(p0 context.Context) error `perm:"web,admin"`
ResetAssetReplicaCount func(p0 context.Context, p1 string, p2 int) error `perm:"web,admin"`
ShareAssetV2 func(p0 context.Context, p1 *types.ShareAssetReq) (*types.ShareAssetRsp, error) `perm:"web,admin,user"`
StopAssetRecord func(p0 context.Context, p1 []string) error `perm:"admin"`
SwitchFillDiskTimer func(p0 context.Context, p1 bool) error `perm:"web,admin"`
UpdateAssetExpiration func(p0 context.Context, p1 string, p2 time.Time) error `perm:"web,admin"`
}
}
func (*AssetAPIStruct) AddAWSData ¶ added in v0.1.13
func (s *AssetAPIStruct) AddAWSData(p0 context.Context, p1 []types.AWSDataInfo) error
func (*AssetAPIStruct) CreateAsset ¶ added in v0.1.10
func (s *AssetAPIStruct) CreateAsset(p0 context.Context, p1 *types.CreateAssetReq) (*types.UploadInfo, error)
func (*AssetAPIStruct) CreateSyncAsset ¶ added in v0.1.21
func (s *AssetAPIStruct) CreateSyncAsset(p0 context.Context, p1 *types.CreateSyncAssetReq) error
func (*AssetAPIStruct) GenerateTokenForDownloadSource ¶ added in v0.1.21
func (s *AssetAPIStruct) GenerateTokenForDownloadSource(p0 context.Context, p1 string, p2 string) (*types.SourceDownloadInfo, error)
func (*AssetAPIStruct) GenerateTokenForDownloadSources ¶ added in v0.1.22
func (s *AssetAPIStruct) GenerateTokenForDownloadSources(p0 context.Context, p1 string) ([]*types.SourceDownloadInfo, error)
func (*AssetAPIStruct) GetActiveAssetRecords ¶ added in v0.1.22
func (s *AssetAPIStruct) GetActiveAssetRecords(p0 context.Context, p1 int, p2 int) (*types.ListAssetRecordRsp, error)
func (*AssetAPIStruct) GetAssetCount ¶ added in v0.1.10
func (s *AssetAPIStruct) GetAssetCount(p0 context.Context) (int, error)
func (*AssetAPIStruct) GetAssetDownloadResults ¶ added in v0.1.22
func (*AssetAPIStruct) GetAssetListForBucket ¶ added in v0.1.10
func (*AssetAPIStruct) GetAssetRecord ¶ added in v0.1.10
func (s *AssetAPIStruct) GetAssetRecord(p0 context.Context, p1 string) (*types.AssetRecord, error)
func (*AssetAPIStruct) GetAssetRecords ¶ added in v0.1.10
func (*AssetAPIStruct) GetAssetRecordsByDateRange ¶ added in v0.1.22
func (*AssetAPIStruct) GetAssetRecordsWithCIDs ¶ added in v0.1.22
func (s *AssetAPIStruct) GetAssetRecordsWithCIDs(p0 context.Context, p1 []string) ([]*types.AssetRecord, error)
func (*AssetAPIStruct) GetAssetsForNode ¶ added in v0.1.10
func (s *AssetAPIStruct) GetAssetsForNode(p0 context.Context, p1 string, p2 int, p3 int) (*types.ListNodeAssetRsp, error)
func (*AssetAPIStruct) GetDownloadResultsFromAssets ¶ added in v0.1.22
func (*AssetAPIStruct) GetFailedReplicaByCID ¶ added in v0.1.22
func (s *AssetAPIStruct) GetFailedReplicaByCID(p0 context.Context, p1 string, p2 int, p3 int) (*types.ListAssetReplicaEventRsp, error)
func (*AssetAPIStruct) GetFailedReplicaByNode ¶ added in v0.1.22
func (s *AssetAPIStruct) GetFailedReplicaByNode(p0 context.Context, p1 string, p2 int, p3 int) (*types.ListAssetReplicaEventRsp, error)
func (*AssetAPIStruct) GetNodeAssetReplicasByHashes ¶ added in v0.1.22
func (s *AssetAPIStruct) GetNodeAssetReplicasByHashes(p0 context.Context, p1 string, p2 []string) ([]*types.ReplicaInfo, error)
func (*AssetAPIStruct) GetReplicaEventsForNode ¶ added in v0.1.10
func (s *AssetAPIStruct) GetReplicaEventsForNode(p0 context.Context, p1 string, p2 int, p3 int) (*types.ListAssetReplicaEventRsp, error)
func (*AssetAPIStruct) GetReplicas ¶ added in v0.1.11
func (s *AssetAPIStruct) GetReplicas(p0 context.Context, p1 string, p2 int, p3 int) (*types.ListReplicaRsp, error)
func (*AssetAPIStruct) GetReplicasForNode ¶ added in v0.1.16
func (s *AssetAPIStruct) GetReplicasForNode(p0 context.Context, p1 string, p2 int, p3 int, p4 []types.ReplicaStatus) (*types.ListNodeReplicaRsp, error)
func (*AssetAPIStruct) GetSucceededReplicaByCID ¶ added in v0.1.22
func (s *AssetAPIStruct) GetSucceededReplicaByCID(p0 context.Context, p1 string, p2 int, p3 int) (*types.ListReplicaRsp, error)
func (*AssetAPIStruct) GetSucceededReplicaByNode ¶ added in v0.1.22
func (s *AssetAPIStruct) GetSucceededReplicaByNode(p0 context.Context, p1 string, p2 int, p3 int) (*types.ListReplicaRsp, error)
func (*AssetAPIStruct) LoadAWSData ¶ added in v0.1.14
func (s *AssetAPIStruct) LoadAWSData(p0 context.Context, p1 int, p2 int, p3 bool) ([]*types.AWSDataInfo, error)
func (*AssetAPIStruct) MinioUploadFileEvent ¶ added in v0.1.11
func (s *AssetAPIStruct) MinioUploadFileEvent(p0 context.Context, p1 *types.MinioUploadFileEvent) error
func (*AssetAPIStruct) NodeRemoveAssetResult ¶ added in v0.1.10
func (s *AssetAPIStruct) NodeRemoveAssetResult(p0 context.Context, p1 types.RemoveAssetResult) error
func (*AssetAPIStruct) PullAsset ¶ added in v0.1.10
func (s *AssetAPIStruct) PullAsset(p0 context.Context, p1 *types.PullAssetReq) error
func (*AssetAPIStruct) RePullFailedAssets ¶ added in v0.1.10
func (*AssetAPIStruct) RemoveAssetRecord ¶ added in v0.1.10
func (s *AssetAPIStruct) RemoveAssetRecord(p0 context.Context, p1 string) error
func (*AssetAPIStruct) RemoveAssetRecords ¶ added in v0.1.22
func (s *AssetAPIStruct) RemoveAssetRecords(p0 context.Context, p1 []string) error
func (*AssetAPIStruct) RemoveAssetReplica ¶ added in v0.1.10
func (*AssetAPIStruct) RemoveNodeFailedReplica ¶ added in v0.1.16
func (s *AssetAPIStruct) RemoveNodeFailedReplica(p0 context.Context) error
func (*AssetAPIStruct) ResetAssetReplicaCount ¶ added in v0.1.22
func (*AssetAPIStruct) ShareAssetV2 ¶ added in v0.1.22
func (s *AssetAPIStruct) ShareAssetV2(p0 context.Context, p1 *types.ShareAssetReq) (*types.ShareAssetRsp, error)
func (*AssetAPIStruct) StopAssetRecord ¶ added in v0.1.14
func (s *AssetAPIStruct) StopAssetRecord(p0 context.Context, p1 []string) error
func (*AssetAPIStruct) SwitchFillDiskTimer ¶ added in v0.1.13
func (s *AssetAPIStruct) SwitchFillDiskTimer(p0 context.Context, p1 bool) error
func (*AssetAPIStruct) UpdateAssetExpiration ¶ added in v0.1.10
type AssetAPIStub ¶ added in v0.1.10
type AssetAPIStub struct {
}
func (*AssetAPIStub) AddAWSData ¶ added in v0.1.13
func (s *AssetAPIStub) AddAWSData(p0 context.Context, p1 []types.AWSDataInfo) error
func (*AssetAPIStub) CreateAsset ¶ added in v0.1.10
func (s *AssetAPIStub) CreateAsset(p0 context.Context, p1 *types.CreateAssetReq) (*types.UploadInfo, error)
func (*AssetAPIStub) CreateSyncAsset ¶ added in v0.1.21
func (s *AssetAPIStub) CreateSyncAsset(p0 context.Context, p1 *types.CreateSyncAssetReq) error
func (*AssetAPIStub) GenerateTokenForDownloadSource ¶ added in v0.1.21
func (s *AssetAPIStub) GenerateTokenForDownloadSource(p0 context.Context, p1 string, p2 string) (*types.SourceDownloadInfo, error)
func (*AssetAPIStub) GenerateTokenForDownloadSources ¶ added in v0.1.22
func (s *AssetAPIStub) GenerateTokenForDownloadSources(p0 context.Context, p1 string) ([]*types.SourceDownloadInfo, error)
func (*AssetAPIStub) GetActiveAssetRecords ¶ added in v0.1.22
func (s *AssetAPIStub) GetActiveAssetRecords(p0 context.Context, p1 int, p2 int) (*types.ListAssetRecordRsp, error)
func (*AssetAPIStub) GetAssetCount ¶ added in v0.1.10
func (s *AssetAPIStub) GetAssetCount(p0 context.Context) (int, error)
func (*AssetAPIStub) GetAssetDownloadResults ¶ added in v0.1.22
func (*AssetAPIStub) GetAssetListForBucket ¶ added in v0.1.10
func (*AssetAPIStub) GetAssetRecord ¶ added in v0.1.10
func (s *AssetAPIStub) GetAssetRecord(p0 context.Context, p1 string) (*types.AssetRecord, error)
func (*AssetAPIStub) GetAssetRecords ¶ added in v0.1.10
func (*AssetAPIStub) GetAssetRecordsByDateRange ¶ added in v0.1.22
func (*AssetAPIStub) GetAssetRecordsWithCIDs ¶ added in v0.1.22
func (s *AssetAPIStub) GetAssetRecordsWithCIDs(p0 context.Context, p1 []string) ([]*types.AssetRecord, error)
func (*AssetAPIStub) GetAssetsForNode ¶ added in v0.1.10
func (s *AssetAPIStub) GetAssetsForNode(p0 context.Context, p1 string, p2 int, p3 int) (*types.ListNodeAssetRsp, error)
func (*AssetAPIStub) GetDownloadResultsFromAssets ¶ added in v0.1.22
func (*AssetAPIStub) GetFailedReplicaByCID ¶ added in v0.1.22
func (s *AssetAPIStub) GetFailedReplicaByCID(p0 context.Context, p1 string, p2 int, p3 int) (*types.ListAssetReplicaEventRsp, error)
func (*AssetAPIStub) GetFailedReplicaByNode ¶ added in v0.1.22
func (s *AssetAPIStub) GetFailedReplicaByNode(p0 context.Context, p1 string, p2 int, p3 int) (*types.ListAssetReplicaEventRsp, error)
func (*AssetAPIStub) GetNodeAssetReplicasByHashes ¶ added in v0.1.22
func (s *AssetAPIStub) GetNodeAssetReplicasByHashes(p0 context.Context, p1 string, p2 []string) ([]*types.ReplicaInfo, error)
func (*AssetAPIStub) GetReplicaEventsForNode ¶ added in v0.1.10
func (s *AssetAPIStub) GetReplicaEventsForNode(p0 context.Context, p1 string, p2 int, p3 int) (*types.ListAssetReplicaEventRsp, error)
func (*AssetAPIStub) GetReplicas ¶ added in v0.1.11
func (s *AssetAPIStub) GetReplicas(p0 context.Context, p1 string, p2 int, p3 int) (*types.ListReplicaRsp, error)
func (*AssetAPIStub) GetReplicasForNode ¶ added in v0.1.16
func (s *AssetAPIStub) GetReplicasForNode(p0 context.Context, p1 string, p2 int, p3 int, p4 []types.ReplicaStatus) (*types.ListNodeReplicaRsp, error)
func (*AssetAPIStub) GetSucceededReplicaByCID ¶ added in v0.1.22
func (s *AssetAPIStub) GetSucceededReplicaByCID(p0 context.Context, p1 string, p2 int, p3 int) (*types.ListReplicaRsp, error)
func (*AssetAPIStub) GetSucceededReplicaByNode ¶ added in v0.1.22
func (s *AssetAPIStub) GetSucceededReplicaByNode(p0 context.Context, p1 string, p2 int, p3 int) (*types.ListReplicaRsp, error)
func (*AssetAPIStub) LoadAWSData ¶ added in v0.1.14
func (s *AssetAPIStub) LoadAWSData(p0 context.Context, p1 int, p2 int, p3 bool) ([]*types.AWSDataInfo, error)
func (*AssetAPIStub) MinioUploadFileEvent ¶ added in v0.1.11
func (s *AssetAPIStub) MinioUploadFileEvent(p0 context.Context, p1 *types.MinioUploadFileEvent) error
func (*AssetAPIStub) NodeRemoveAssetResult ¶ added in v0.1.10
func (s *AssetAPIStub) NodeRemoveAssetResult(p0 context.Context, p1 types.RemoveAssetResult) error
func (*AssetAPIStub) PullAsset ¶ added in v0.1.10
func (s *AssetAPIStub) PullAsset(p0 context.Context, p1 *types.PullAssetReq) error
func (*AssetAPIStub) RePullFailedAssets ¶ added in v0.1.10
func (*AssetAPIStub) RemoveAssetRecord ¶ added in v0.1.10
func (s *AssetAPIStub) RemoveAssetRecord(p0 context.Context, p1 string) error
func (*AssetAPIStub) RemoveAssetRecords ¶ added in v0.1.22
func (s *AssetAPIStub) RemoveAssetRecords(p0 context.Context, p1 []string) error
func (*AssetAPIStub) RemoveAssetReplica ¶ added in v0.1.10
func (*AssetAPIStub) RemoveNodeFailedReplica ¶ added in v0.1.16
func (s *AssetAPIStub) RemoveNodeFailedReplica(p0 context.Context) error
func (*AssetAPIStub) ResetAssetReplicaCount ¶ added in v0.1.22
func (*AssetAPIStub) ShareAssetV2 ¶ added in v0.1.22
func (s *AssetAPIStub) ShareAssetV2(p0 context.Context, p1 *types.ShareAssetReq) (*types.ShareAssetRsp, error)
func (*AssetAPIStub) StopAssetRecord ¶ added in v0.1.14
func (s *AssetAPIStub) StopAssetRecord(p0 context.Context, p1 []string) error
func (*AssetAPIStub) SwitchFillDiskTimer ¶ added in v0.1.13
func (s *AssetAPIStub) SwitchFillDiskTimer(p0 context.Context, p1 bool) error
func (*AssetAPIStub) UpdateAssetExpiration ¶ added in v0.1.10
type AssetStruct ¶
type AssetStruct struct {
Internal struct {
AddAssetView func(p0 context.Context, p1 []string) error `perm:"admin"`
ClearFreeUpDisk func(p0 context.Context) error `perm:"admin"`
CreateAsset func(p0 context.Context, p1 *types.AuthUserUploadDownloadAsset) (string, error) `perm:"admin"`
DeleteAsset func(p0 context.Context, p1 string) error `perm:"admin"`
GetAssetProgresses func(p0 context.Context, p1 []string) (*types.PullResult, error) `perm:"admin"`
GetAssetStats func(p0 context.Context) (*types.AssetStats, error) `perm:"admin"`
GetAssetView func(p0 context.Context) (*types.AssetView, error) `perm:"admin"`
GetAssetsInBucket func(p0 context.Context, p1 int) ([]string, error) `perm:"admin"`
GetPullingAssetInfo func(p0 context.Context) (*types.InProgressAsset, error) `perm:"admin"`
PullAsset func(p0 context.Context, p1 string, p2 []*types.CandidateDownloadInfo) error `perm:"admin"`
PullAssetFromAWS func(p0 context.Context, p1 string, p2 string) error `perm:"admin"`
PullAssetV2 func(p0 context.Context, p1 *types.AssetPullRequest) error `perm:"admin"`
RequestFreeUpDisk func(p0 context.Context, p1 float64) error `perm:"admin"`
StateFreeUpDisk func(p0 context.Context) (*types.FreeUpDiskStateResp, error) `perm:"admin"`
SyncAssetViewAndData func(p0 context.Context) error `perm:"admin"`
}
}
func (*AssetStruct) AddAssetView ¶ added in v0.1.15
func (s *AssetStruct) AddAssetView(p0 context.Context, p1 []string) error
func (*AssetStruct) ClearFreeUpDisk ¶ added in v0.1.19
func (s *AssetStruct) ClearFreeUpDisk(p0 context.Context) error
func (*AssetStruct) CreateAsset ¶ added in v0.1.10
func (s *AssetStruct) CreateAsset(p0 context.Context, p1 *types.AuthUserUploadDownloadAsset) (string, error)
func (*AssetStruct) DeleteAsset ¶
func (s *AssetStruct) DeleteAsset(p0 context.Context, p1 string) error
func (*AssetStruct) GetAssetProgresses ¶
func (s *AssetStruct) GetAssetProgresses(p0 context.Context, p1 []string) (*types.PullResult, error)
func (*AssetStruct) GetAssetStats ¶
func (s *AssetStruct) GetAssetStats(p0 context.Context) (*types.AssetStats, error)
func (*AssetStruct) GetAssetView ¶ added in v0.1.14
func (*AssetStruct) GetAssetsInBucket ¶ added in v0.1.14
func (*AssetStruct) GetPullingAssetInfo ¶
func (s *AssetStruct) GetPullingAssetInfo(p0 context.Context) (*types.InProgressAsset, error)
func (*AssetStruct) PullAsset ¶
func (s *AssetStruct) PullAsset(p0 context.Context, p1 string, p2 []*types.CandidateDownloadInfo) error
func (*AssetStruct) PullAssetFromAWS ¶ added in v0.1.13
func (*AssetStruct) PullAssetV2 ¶ added in v0.1.19
func (s *AssetStruct) PullAssetV2(p0 context.Context, p1 *types.AssetPullRequest) error
func (*AssetStruct) RequestFreeUpDisk ¶ added in v0.1.19
func (s *AssetStruct) RequestFreeUpDisk(p0 context.Context, p1 float64) error
func (*AssetStruct) StateFreeUpDisk ¶ added in v0.1.19
func (s *AssetStruct) StateFreeUpDisk(p0 context.Context) (*types.FreeUpDiskStateResp, error)
func (*AssetStruct) SyncAssetViewAndData ¶ added in v0.1.16
func (s *AssetStruct) SyncAssetViewAndData(p0 context.Context) error
type AssetStub ¶
type AssetStub struct {
}
func (*AssetStub) AddAssetView ¶ added in v0.1.15
func (*AssetStub) ClearFreeUpDisk ¶ added in v0.1.19
func (*AssetStub) CreateAsset ¶ added in v0.1.10
func (*AssetStub) DeleteAsset ¶
func (*AssetStub) GetAssetProgresses ¶
func (*AssetStub) GetAssetStats ¶
func (*AssetStub) GetAssetView ¶ added in v0.1.14
func (*AssetStub) GetAssetsInBucket ¶ added in v0.1.14
func (*AssetStub) GetPullingAssetInfo ¶
func (*AssetStub) PullAssetFromAWS ¶ added in v0.1.13
func (*AssetStub) PullAssetV2 ¶ added in v0.1.19
func (*AssetStub) RequestFreeUpDisk ¶ added in v0.1.19
func (*AssetStub) StateFreeUpDisk ¶ added in v0.1.19
type Candidate ¶
type Candidate interface {
Common
Device
Validation
DataSync
Asset
WaitQuiet(ctx context.Context) error //perm:admin
GetBlocksWithAssetCID(ctx context.Context, assetCID string, randomSeed int64, randomCount int) ([]string, error) //perm:admin
// GetExternalAddress retrieves the external address of the caller.
GetExternalAddress(ctx context.Context) (string, error) //perm:default
// CheckNetworkConnectivity deprecated
CheckNetworkConnectivity(ctx context.Context, network, targetURL string) error //perm:default
// CheckNetworkConnectable check network if connectable
CheckNetworkConnectable(ctx context.Context, network, targetURL string) (bool, error) //perm:admin
GetMinioConfig(ctx context.Context) (*types.MinioConfig, error) //perm:admin
DeactivateNode(ctx context.Context) error //perm:default
CalculateExitProfit(ctx context.Context) (types.ExitProfitRsp, error) //perm:default
}
Candidate is an interface for candidate node
type CandidateStruct ¶
type CandidateStruct struct {
CommonStruct
DeviceStruct
ValidationStruct
DataSyncStruct
AssetStruct
Internal struct {
CalculateExitProfit func(p0 context.Context) (types.ExitProfitRsp, error) `perm:"default"`
CheckNetworkConnectable func(p0 context.Context, p1 string, p2 string) (bool, error) `perm:"admin"`
CheckNetworkConnectivity func(p0 context.Context, p1 string, p2 string) error `perm:"default"`
DeactivateNode func(p0 context.Context) error `perm:"default"`
GetBlocksWithAssetCID func(p0 context.Context, p1 string, p2 int64, p3 int) ([]string, error) `perm:"admin"`
GetExternalAddress func(p0 context.Context) (string, error) `perm:"default"`
GetMinioConfig func(p0 context.Context) (*types.MinioConfig, error) `perm:"admin"`
WaitQuiet func(p0 context.Context) error `perm:"admin"`
}
}
func (*CandidateStruct) CalculateExitProfit ¶ added in v0.1.21
func (s *CandidateStruct) CalculateExitProfit(p0 context.Context) (types.ExitProfitRsp, error)
func (*CandidateStruct) CheckNetworkConnectable ¶ added in v0.1.18
func (*CandidateStruct) CheckNetworkConnectivity ¶
func (*CandidateStruct) DeactivateNode ¶ added in v0.1.21
func (s *CandidateStruct) DeactivateNode(p0 context.Context) error
func (*CandidateStruct) GetBlocksWithAssetCID ¶
func (*CandidateStruct) GetExternalAddress ¶
func (s *CandidateStruct) GetExternalAddress(p0 context.Context) (string, error)
func (*CandidateStruct) GetMinioConfig ¶ added in v0.1.11
func (s *CandidateStruct) GetMinioConfig(p0 context.Context) (*types.MinioConfig, error)
type CandidateStub ¶
type CandidateStub struct {
CommonStub
DeviceStub
ValidationStub
DataSyncStub
AssetStub
}
func (*CandidateStub) CalculateExitProfit ¶ added in v0.1.21
func (s *CandidateStub) CalculateExitProfit(p0 context.Context) (types.ExitProfitRsp, error)
func (*CandidateStub) CheckNetworkConnectable ¶ added in v0.1.18
func (*CandidateStub) CheckNetworkConnectivity ¶
func (*CandidateStub) DeactivateNode ¶ added in v0.1.21
func (s *CandidateStub) DeactivateNode(p0 context.Context) error
func (*CandidateStub) GetBlocksWithAssetCID ¶
func (*CandidateStub) GetExternalAddress ¶
func (s *CandidateStub) GetExternalAddress(p0 context.Context) (string, error)
func (*CandidateStub) GetMinioConfig ¶ added in v0.1.11
func (s *CandidateStub) GetMinioConfig(p0 context.Context) (*types.MinioConfig, error)
type Common ¶
type Common interface {
// AuthVerify checks whether the specified token is valid and returns the list of permissions associated with it.
AuthVerify(ctx context.Context, token string) (*types.JWTPayload, error) //perm:default
// AuthNew creates a new token with the specified list of permissions.
AuthNew(ctx context.Context, payload *types.JWTPayload) (string, error) //perm:admin
// LogList returns a list of all logs in the system.
LogList(context.Context) ([]string, error) //perm:admin
// LogSetLevel sets the log level of the specified logger.
LogSetLevel(context.Context, string, string) error //perm:admin
// LogAlerts returns list of all, active and inactive alerts tracked by the
LogAlerts(ctx context.Context) ([]alerting.Alert, error) //perm:admin
// Version provides information about API provider
Version(context.Context) (APIVersion, error) //perm:default
// Discover returns an OpenRPC document describing an RPC API.
Discover(ctx context.Context) (types.OpenRPCDocument, error) //perm:admin
// Shutdown trigger graceful shutdown
Shutdown(context.Context) error //perm:admin
// Session returns a UUID of api provider session
Session(ctx context.Context) (uuid.UUID, error) //perm:edge,candidate,l5
// Closing jsonrpc closing
Closing(context.Context) (<-chan struct{}, error) //perm:admin
// ExternalServiceAddress check service address with different candidate
// if behind nat, service address maybe different
ExternalServiceAddress(ctx context.Context, rpcURL string) (string, error) //perm:admin
}
Common is an interface for titan network
type CommonStruct ¶
type CommonStruct struct {
Internal struct {
AuthNew func(p0 context.Context, p1 *types.JWTPayload) (string, error) `perm:"admin"`
AuthVerify func(p0 context.Context, p1 string) (*types.JWTPayload, error) `perm:"default"`
Closing func(p0 context.Context) (<-chan struct{}, error) `perm:"admin"`
Discover func(p0 context.Context) (types.OpenRPCDocument, error) `perm:"admin"`
ExternalServiceAddress func(p0 context.Context, p1 string) (string, error) `perm:"admin"`
LogAlerts func(p0 context.Context) ([]alerting.Alert, error) `perm:"admin"`
LogList func(p0 context.Context) ([]string, error) `perm:"admin"`
LogSetLevel func(p0 context.Context, p1 string, p2 string) error `perm:"admin"`
Session func(p0 context.Context) (uuid.UUID, error) `perm:"edge,candidate,l5"`
Shutdown func(p0 context.Context) error `perm:"admin"`
Version func(p0 context.Context) (APIVersion, error) `perm:"default"`
}
}
func (*CommonStruct) AuthNew ¶
func (s *CommonStruct) AuthNew(p0 context.Context, p1 *types.JWTPayload) (string, error)
func (*CommonStruct) AuthVerify ¶
func (s *CommonStruct) AuthVerify(p0 context.Context, p1 string) (*types.JWTPayload, error)
func (*CommonStruct) Closing ¶
func (s *CommonStruct) Closing(p0 context.Context) (<-chan struct{}, error)
func (*CommonStruct) Discover ¶
func (s *CommonStruct) Discover(p0 context.Context) (types.OpenRPCDocument, error)
func (*CommonStruct) ExternalServiceAddress ¶ added in v0.1.19
func (*CommonStruct) LogSetLevel ¶
func (*CommonStruct) Version ¶
func (s *CommonStruct) Version(p0 context.Context) (APIVersion, error)
type CommonStub ¶
type CommonStub struct {
}
func (*CommonStub) AuthNew ¶
func (s *CommonStub) AuthNew(p0 context.Context, p1 *types.JWTPayload) (string, error)
func (*CommonStub) AuthVerify ¶
func (s *CommonStub) AuthVerify(p0 context.Context, p1 string) (*types.JWTPayload, error)
func (*CommonStub) Closing ¶
func (s *CommonStub) Closing(p0 context.Context) (<-chan struct{}, error)
func (*CommonStub) Discover ¶
func (s *CommonStub) Discover(p0 context.Context) (types.OpenRPCDocument, error)
func (*CommonStub) ExternalServiceAddress ¶ added in v0.1.19
func (*CommonStub) LogSetLevel ¶
func (*CommonStub) Version ¶
func (s *CommonStub) Version(p0 context.Context) (APIVersion, error)
type DataSync ¶
type DataSync interface {
// CompareTopHash check asset if same as scheduler.
// topHash is hash of all buckets
CompareTopHash(ctx context.Context, topHash string) (bool, error) //perm:admin
// CompareBucketHashes group asset in bucket, and compare single bucket hash
// hashes are map of bucket, key is number of bucket, value is hash
// return mismatch bucket number
CompareBucketHashes(ctx context.Context, hashes map[uint32]string) ([]uint32, error) //perm:admin
}
DataSync sync scheduler asset to node
type DataSyncStruct ¶
type DataSyncStruct struct {
Internal struct {
CompareBucketHashes func(p0 context.Context, p1 map[uint32]string) ([]uint32, error) `perm:"admin"`
CompareTopHash func(p0 context.Context, p1 string) (bool, error) `perm:"admin"`
}
}
func (*DataSyncStruct) CompareBucketHashes ¶
func (*DataSyncStruct) CompareTopHash ¶
type DataSyncStub ¶
type DataSyncStub struct {
}
func (*DataSyncStub) CompareBucketHashes ¶
func (*DataSyncStub) CompareTopHash ¶
type Device ¶
type Device interface {
GetNodeInfo(ctx context.Context) (types.NodeInfo, error) //perm:admin
GetNodeID(ctx context.Context) (string, error) //perm:admin
GetDeviceRunningStat(ctx context.Context) (*types.DeviceRunningStat, error) //perm:admin
}
Device is an interface for node
type DeviceStruct ¶
type DeviceStruct struct {
Internal struct {
GetDeviceRunningStat func(p0 context.Context) (*types.DeviceRunningStat, error) `perm:"admin"`
GetNodeID func(p0 context.Context) (string, error) `perm:"admin"`
GetNodeInfo func(p0 context.Context) (types.NodeInfo, error) `perm:"admin"`
}
}
func (*DeviceStruct) GetDeviceRunningStat ¶ added in v0.1.22
func (s *DeviceStruct) GetDeviceRunningStat(p0 context.Context) (*types.DeviceRunningStat, error)
func (*DeviceStruct) GetNodeID ¶
func (s *DeviceStruct) GetNodeID(p0 context.Context) (string, error)
func (*DeviceStruct) GetNodeInfo ¶
type DeviceStub ¶
type DeviceStub struct {
}
func (*DeviceStub) GetDeviceRunningStat ¶ added in v0.1.22
func (s *DeviceStub) GetDeviceRunningStat(p0 context.Context) (*types.DeviceRunningStat, error)
func (*DeviceStub) GetNodeInfo ¶
type Edge ¶
type Edge interface {
Common
Device
Validation
DataSync
Asset
Workerd
WaitQuiet(ctx context.Context) error //perm:admin
// UserNATTravel build connection for user
UserNATPunch(ctx context.Context, userServiceAddress string, req *types.NatPunchReq) error //perm:admin
// GetEdgeOnlineStateFromScheduler this online state is get from scheduler
GetEdgeOnlineStateFromScheduler(ctx context.Context) (bool, error) //perm:default
// Restart trigger graceful restart of edge node
Restart(ctx context.Context) error // perm:admin
// CreateTunnel create a tunnel for workerd communication
CreateTunnel(ctx context.Context, req *types.CreateTunnelReq) error // perm:admin
}
Edge is an interface for edge node
func PermissionedEdgeAPI ¶
type EdgeStruct ¶
type EdgeStruct struct {
CommonStruct
DeviceStruct
ValidationStruct
DataSyncStruct
AssetStruct
WorkerdStruct
Internal struct {
CreateTunnel func(p0 context.Context, p1 *types.CreateTunnelReq) error `perm:"admin"`
GetEdgeOnlineStateFromScheduler func(p0 context.Context) (bool, error) `perm:"default"`
Restart func(p0 context.Context) error `perm:"admin"`
UserNATPunch func(p0 context.Context, p1 string, p2 *types.NatPunchReq) error `perm:"admin"`
WaitQuiet func(p0 context.Context) error `perm:"admin"`
}
}
func (*EdgeStruct) CreateTunnel ¶ added in v0.1.21
func (s *EdgeStruct) CreateTunnel(p0 context.Context, p1 *types.CreateTunnelReq) error
func (*EdgeStruct) GetEdgeOnlineStateFromScheduler ¶ added in v0.1.13
func (s *EdgeStruct) GetEdgeOnlineStateFromScheduler(p0 context.Context) (bool, error)
func (*EdgeStruct) Restart ¶ added in v0.1.19
func (s *EdgeStruct) Restart(p0 context.Context) error
func (*EdgeStruct) UserNATPunch ¶
func (s *EdgeStruct) UserNATPunch(p0 context.Context, p1 string, p2 *types.NatPunchReq) error
type EdgeStub ¶
type EdgeStub struct {
CommonStub
DeviceStub
ValidationStub
DataSyncStub
AssetStub
WorkerdStub
}
func (*EdgeStub) CreateTunnel ¶ added in v0.1.21
func (*EdgeStub) GetEdgeOnlineStateFromScheduler ¶ added in v0.1.13
func (*EdgeStub) UserNATPunch ¶
type EdgeUpdateConfig ¶
type EdgeUpdateConfig struct {
NodeType int `db:"node_type"`
AppName string `db:"app_name"`
Version Version `db:"version"`
DownloadURL string `db:"download_url"`
Hash string `db:"hash"`
UpdateTime time.Time `db:"update_time"`
}
EdgeUpdateInfo just update edge node NodeType include edge-updater and titan-edge
type ErrUnknown ¶
type ErrUnknown struct{}
func (*ErrUnknown) Error ¶
func (eu *ErrUnknown) Error() string
type ErrWeb ¶ added in v0.1.11
func (*ErrWeb) MarshalJSON ¶ added in v0.1.11
func (*ErrWeb) UnmarshalJSON ¶ added in v0.1.11
type L5Struct ¶ added in v0.1.21
type L5Struct struct {
CommonStruct
Internal struct {
WaitQuiet func(p0 context.Context) error `perm:"admin"`
}
}
type L5Stub ¶ added in v0.1.21
type L5Stub struct {
CommonStub
}
type Locator ¶
type Locator interface {
Common
// GetAccessPoints retrieves all access points associated with a node.
GetAccessPoints(ctx context.Context, nodeID, areaID string) ([]string, error) //perm:default
// GetAccessPointsV2 retrieves all access points associated with a node.
GetAccessPointsV2(ctx context.Context, nodeID, areaID string) (*types.AccessPointRsp, error) //perm:default
// user api
// EdgeDownloadInfos retrieves download information for a content identifier (CID).
EdgeDownloadInfos(ctx context.Context, cid string) ([]*types.EdgeDownloadInfoList, error) //perm:default
// GetUserAccessPoint retrieves an access point for a user with a specified IP address.
GetUserAccessPoint(ctx context.Context, userIP string) (*AccessPoint, error) //perm:default
// CandidateDownloadInfos retrieves information about candidate's download interface
CandidateDownloadInfos(ctx context.Context, cid string) ([]*types.CandidateDownloadInfo, error) //perm:default
// GetAssetSourceDownloadInfo
GetAssetSourceDownloadInfos(ctx context.Context, cid string) ([]*types.AssetSourceDownloadInfoRsp, error) //perm:default
// GetCandidateIP retrieves ip of candidate, used in the locator dns
GetCandidateIP(ctx context.Context, nodeID string) (string, error) //perm:admin
// GetSchedulerWithNode get the scheduler that the node is already connected to
GetSchedulerWithNode(ctx context.Context, nodeID string) (string, error) //perm:default
// // GetSchedulerWithAPIKey get the scheduler that the user create the api key
// GetSchedulerWithAPIKey(ctx context.Context, apiKey string) (string, error) //perm:default
AllocateSchedulerForNode(ctx context.Context, nodeType types.NodeType, code string) (string, error) //perm:default
GetDeploymentCandidateIP(ctx context.Context, deploymentID string) (string, error) //perm:default
}
Locator is an interface for locator services
func PermissionedLocationAPI ¶
type LocatorStruct ¶
type LocatorStruct struct {
CommonStruct
Internal struct {
AllocateSchedulerForNode func(p0 context.Context, p1 types.NodeType, p2 string) (string, error) `perm:"default"`
CandidateDownloadInfos func(p0 context.Context, p1 string) ([]*types.CandidateDownloadInfo, error) `perm:"default"`
EdgeDownloadInfos func(p0 context.Context, p1 string) ([]*types.EdgeDownloadInfoList, error) `perm:"default"`
GetAccessPoints func(p0 context.Context, p1 string, p2 string) ([]string, error) `perm:"default"`
GetAccessPointsV2 func(p0 context.Context, p1 string, p2 string) (*types.AccessPointRsp, error) `perm:"default"`
GetAssetSourceDownloadInfos func(p0 context.Context, p1 string) ([]*types.AssetSourceDownloadInfoRsp, error) `perm:"default"`
GetCandidateIP func(p0 context.Context, p1 string) (string, error) `perm:"admin"`
GetDeploymentCandidateIP func(p0 context.Context, p1 string) (string, error) `perm:"default"`
GetSchedulerWithNode func(p0 context.Context, p1 string) (string, error) `perm:"default"`
GetUserAccessPoint func(p0 context.Context, p1 string) (*AccessPoint, error) `perm:"default"`
}
}
func (*LocatorStruct) AllocateSchedulerForNode ¶ added in v0.1.19
func (*LocatorStruct) CandidateDownloadInfos ¶ added in v0.1.10
func (s *LocatorStruct) CandidateDownloadInfos(p0 context.Context, p1 string) ([]*types.CandidateDownloadInfo, error)
func (*LocatorStruct) EdgeDownloadInfos ¶
func (s *LocatorStruct) EdgeDownloadInfos(p0 context.Context, p1 string) ([]*types.EdgeDownloadInfoList, error)
func (*LocatorStruct) GetAccessPoints ¶
func (*LocatorStruct) GetAccessPointsV2 ¶ added in v0.1.21
func (s *LocatorStruct) GetAccessPointsV2(p0 context.Context, p1 string, p2 string) (*types.AccessPointRsp, error)
func (*LocatorStruct) GetAssetSourceDownloadInfos ¶ added in v0.1.18
func (s *LocatorStruct) GetAssetSourceDownloadInfos(p0 context.Context, p1 string) ([]*types.AssetSourceDownloadInfoRsp, error)
func (*LocatorStruct) GetCandidateIP ¶ added in v0.1.11
func (*LocatorStruct) GetDeploymentCandidateIP ¶ added in v0.1.21
func (*LocatorStruct) GetSchedulerWithNode ¶ added in v0.1.11
func (*LocatorStruct) GetUserAccessPoint ¶
func (s *LocatorStruct) GetUserAccessPoint(p0 context.Context, p1 string) (*AccessPoint, error)
type LocatorStub ¶
type LocatorStub struct {
CommonStub
}
func (*LocatorStub) AllocateSchedulerForNode ¶ added in v0.1.19
func (*LocatorStub) CandidateDownloadInfos ¶ added in v0.1.10
func (s *LocatorStub) CandidateDownloadInfos(p0 context.Context, p1 string) ([]*types.CandidateDownloadInfo, error)
func (*LocatorStub) EdgeDownloadInfos ¶
func (s *LocatorStub) EdgeDownloadInfos(p0 context.Context, p1 string) ([]*types.EdgeDownloadInfoList, error)
func (*LocatorStub) GetAccessPoints ¶
func (*LocatorStub) GetAccessPointsV2 ¶ added in v0.1.21
func (s *LocatorStub) GetAccessPointsV2(p0 context.Context, p1 string, p2 string) (*types.AccessPointRsp, error)
func (*LocatorStub) GetAssetSourceDownloadInfos ¶ added in v0.1.18
func (s *LocatorStub) GetAssetSourceDownloadInfos(p0 context.Context, p1 string) ([]*types.AssetSourceDownloadInfoRsp, error)
func (*LocatorStub) GetCandidateIP ¶ added in v0.1.11
func (*LocatorStub) GetDeploymentCandidateIP ¶ added in v0.1.21
func (*LocatorStub) GetSchedulerWithNode ¶ added in v0.1.11
func (*LocatorStub) GetUserAccessPoint ¶
func (s *LocatorStub) GetUserAccessPoint(p0 context.Context, p1 string) (*AccessPoint, error)
type NodeAPI ¶ added in v0.1.10
type NodeAPI interface {
// Node-related methods
// GetOnlineNodeCount returns the count of online nodes for a given node type
GetOnlineNodeCount(ctx context.Context, nodeType types.NodeType) (int, error) //perm:web,admin
// RegisterNode adds new node to the scheduler
RegisterNode(ctx context.Context, nodeID, publicKey string, nodeType types.NodeType) (*types.ActivationDetail, error) //perm:default
// RegisterEdgeNode adds new edge node to the scheduler
RegisterEdgeNode(ctx context.Context, nodeID, publicKey string) (*types.ActivationDetail, error) //perm:default
// RegisterCandidateNode adds new node to the scheduler
RegisterCandidateNode(ctx context.Context, nodeID, publicKey, code string) (*types.ActivationDetail, error) //perm:default
// RegisterNodeV2 adds new edge node to the scheduler
RegisterNodeV2(ctx context.Context, info types.NodeRegister) (*types.ActivationDetail, error) //perm:default
// DeactivateNode is used to deactivate a node in the titan server.
// It stops the node from serving any requests and marks it as inactive.
// - nodeID: The ID of the node to deactivate.
// - hours: The deactivation countdown time in hours. It specifies the duration
// before the deactivation is executed. If the deactivation is canceled within
// this period, the node will remain active.
DeactivateNode(ctx context.Context, nodeID string, hours int) error //perm:web,admin,candidate
DeactivateNodeV2(ctx context.Context, nodeID string, hours int, reductionRate float64) error //perm:web,admin,candidate
// ForceNodeOffline changes the online status of a node identified by nodeID.
// If the status is true, it forces the node offline. If the status is false, it brings the node back online.
ForceNodeOffline(ctx context.Context, nodeID string, forceOffline bool) error //perm:web,admin
// MigrateNodeOut Migrate out the node
MigrateNodeOut(ctx context.Context, nodeID string) (*types.NodeMigrateInfo, error) //perm:web,admin
// MigrateNodeIn Migrate in the node
MigrateNodeIn(ctx context.Context, info *types.NodeMigrateInfo) error //perm:web,admin
// CleanupNode removes residual data from the source server after a node has been migrated.
CleanupNode(ctx context.Context, nodeID, key string) error //perm:web,admin
// CalculateExitProfit please use CalculateDowntimePenalty
CalculateExitProfit(ctx context.Context, nodeID string) (types.ExitProfitRsp, error) //perm:web,admin,candidate
// CalculateDowntimePenalty calculates the penalty points to be deducted for a node's requested downtime.
CalculateDowntimePenalty(ctx context.Context, nodeID string) (types.ExitProfitRsp, error) //perm:web,admin,candidate
// UndoNodeDeactivation is used to undo the deactivation of a node in the titan server.
// It allows the previously deactivated node to start serving requests again.
UndoNodeDeactivation(ctx context.Context, nodeID string) error //perm:web,admin
// UpdateNodePort updates the port for the node with the specified node
UpdateNodePort(ctx context.Context, nodeID, port string) error //perm:web,admin
// EdgeConnect edge node login to the scheduler
EdgeConnect(ctx context.Context, opts *types.ConnectOptions) error //perm:edge
// CandidateConnect candidate node login to the scheduler
CandidateConnect(ctx context.Context, opts *types.ConnectOptions) error //perm:candidate
// L5Connect l5 node login to the scheduler
L5Connect(ctx context.Context, opts *types.ConnectOptions) error //perm:l5
// L3Connect l3 node login to the scheduler
L3Connect(ctx context.Context, opts *types.ConnectOptions) error //perm:edge
// GetExternalAddress retrieves the external address of the caller.
GetExternalAddress(ctx context.Context) (string, error) //perm:default
// NodeLogin generates an authentication token for a node with the specified node ID and signature
NodeLogin(ctx context.Context, nodeID, sign string) (string, error) //perm:default
// GetNodeInfo get information for node
GetNodeInfo(ctx context.Context, nodeID string) (*types.NodeInfo, error) //perm:web,admin
// GetNodeList retrieves a list of nodes with pagination using the specified cursor and count
GetNodeList(ctx context.Context, cursor int, count int) (*types.ListNodesRsp, error) //perm:web,admin
// GetNodesFromRegion retrieves a list of nodes with pagination using the specified cursor and count
GetNodesFromRegion(ctx context.Context, areaID string) ([]*types.NodeInfo, error) //perm:web,admin
// GetCurrentRegionInfos retrieves a list of nodes with pagination using the specified cursor and count
GetCurrentRegionInfos(ctx context.Context, areaID string) (map[string]int, error) //perm:web,admin
// GetCandidateURLsForDetectNat Get the rpc url of the specified number of candidate nodes
GetCandidateURLsForDetectNat(ctx context.Context) ([]string, error) //perm:default
// GetEdgeExternalServiceAddress nat travel, get edge external addr with different candidate
GetEdgeExternalServiceAddress(ctx context.Context, nodeID, candidateURL string) (string, error) //perm:admin
// NatPunch nat punch between user and node
NatPunch(ctx context.Context, target *types.NatPunchReq) error //perm:default
// GetEdgeDownloadInfos retrieves download information for the edge with the asset with the specified CID.
GetEdgeDownloadInfos(ctx context.Context, cid string) (*types.EdgeDownloadInfoList, error) //perm:default
// GetCandidateDownloadInfos retrieves download information for the candidate with the asset with the specified CID.
GetCandidateDownloadInfos(ctx context.Context, cid string) ([]*types.CandidateDownloadInfo, error) //perm:edge,candidate,web,locator
// GetAssetSourceDownloadInfo retrieves the download details for a specified asset.
GetAssetSourceDownloadInfo(ctx context.Context, cid string) (*types.AssetSourceDownloadInfoRsp, error) //perm:edge,candidate,web,locator
// NodeExists checks if the node with the specified ID exists.
NodeExists(ctx context.Context, nodeID string) error //perm:web
// NodeKeepalive
NodeKeepalive(ctx context.Context) (*types.KeepaliveRsp, error) //perm:edge,candidate
// NodeKeepaliveV2 fix the problem of NodeKeepalive, Maintaining old device connections
NodeKeepaliveV2(ctx context.Context) (uuid.UUID, error) //perm:edge,candidate,l5
// NodeKeepaliveV3
NodeKeepaliveV3(ctx context.Context, req *types.KeepaliveReq) (*types.KeepaliveRsp, error) //perm:edge,candidate,l5
// RequestActivationCodes Get the device's encrypted activation code
RequestActivationCodes(ctx context.Context, nodeType types.NodeType, count int) ([]*types.NodeActivation, error) //perm:web,admin
// VerifyTokenWithLimitCount verify token in limit count
VerifyTokenWithLimitCount(ctx context.Context, token string) (*types.JWTPayload, error) //perm:edge,candidate
// UpdateBandwidths update node bandwidthDown and bandwidthUp
UpdateBandwidths(ctx context.Context, bandwidthDown, bandwidthUp int64) error //perm:edge,candidate
// GetCandidateNodeIP get candidate ip for locator
GetCandidateNodeIP(ctx context.Context, nodeID string) (string, error) //perm:web,admin
// GetMinioConfigFromCandidate get minio config from candidate
GetMinioConfigFromCandidate(ctx context.Context, nodeID string) (*types.MinioConfig, error) //perm:default
// GetCandidateIPs get candidate ips
GetCandidateIPs(ctx context.Context) ([]*types.NodeIPInfo, error) //perm:web,user,admin
// GetNodeOnlineState get node online state
GetNodeOnlineState(ctx context.Context) (bool, error) //perm:edge
// DownloadDataResult node download data from AWS result
DownloadDataResult(ctx context.Context, bucket, cid string, size int64) error //perm:edge,candidate
// GetNodeToken get node token
GetNodeToken(ctx context.Context, nodeID string) (string, error) //perm:admin
// CheckIpUsage checks if a specific IP address is present on the server.
CheckIpUsage(ctx context.Context, ip string) (bool, error) //perm:admin,web,locator
// GetAssetView get the asset view of node
GetAssetView(ctx context.Context, nodeID string, isFromNode bool) (*types.AssetView, error) //perm:admin
// GetAssetInBucket get the assets of the bucket
GetAssetsInBucket(ctx context.Context, nodeID string, bucketID int, isFromNode bool) ([]string, error) //perm:admin
// GetNodeOfIP get nodes
GetNodeOfIP(ctx context.Context, ip string) ([]string, error) //perm:admin,web,locator
// PerformSyncData sync the assetView of scheduler and node
PerformSyncData(ctx context.Context, nodeID string) error //perm:admin
// GetProfitDetailsForNode retrieves a profit list of node
GetProfitDetailsForNode(ctx context.Context, nodeID string, limit, offset int, ts []int) (*types.ListNodeProfitDetailsRsp, error) //perm:web,admin
// FreeUpDiskSpace Request to free up disk space, returns free hashes and next time
FreeUpDiskSpace(ctx context.Context, nodeID string, size int64) (*types.FreeUpDiskResp, error) //perm:edge,candidate,admin
// GetNextFreeTime returns the next free up time
GetNextFreeTime(ctx context.Context, nodeID string) (int64, error) //perm:edge,candidate,admin
// ReDetermineNodeNATType
ReDetermineNodeNATType(ctx context.Context, nodeID string) error //perm:admin,web,locator
// SetTunserverURL
SetTunserverURL(ctx context.Context, nodeID, wsNodeID string) error //perm:admin,web,locator
// RecompenseNodeProfit
RecompenseNodeProfit(ctx context.Context, nodeID, note string, profit float64) error //perm:admin,web,locator
// GetTunserverURLFromUser
GetTunserverURLFromUser(ctx context.Context, req *types.TunserverReq) (*types.TunserverRsp, error) //perm:admin,web,locator
// CreateTunnel create tunnel for workerd communication
CreateTunnel(ctx context.Context, req *types.CreateTunnelReq) error // perm:candidate
// UserAssetDownloadResult After a user downloads a resource from a candidate node, the candidate node reports the download result
UserAssetDownloadResultV2(ctx context.Context, info *types.RetrieveEvent) error //perm:candidate
// LoadNodeBandwidthScores
LoadNodeBandwidthScores(ctx context.Context, nodeID string, start, end time.Time, limit int, offset int) (*types.ListBandwidthScoreRsp, error) //perm:user,web,admin
}
NodeAPI is an interface for node
type NodeAPIStruct ¶ added in v0.1.10
type NodeAPIStruct struct {
Internal struct {
CalculateDowntimePenalty func(p0 context.Context, p1 string) (types.ExitProfitRsp, error) `perm:"web,admin,candidate"`
CalculateExitProfit func(p0 context.Context, p1 string) (types.ExitProfitRsp, error) `perm:"web,admin,candidate"`
CandidateConnect func(p0 context.Context, p1 *types.ConnectOptions) error `perm:"candidate"`
CheckIpUsage func(p0 context.Context, p1 string) (bool, error) `perm:"admin,web,locator"`
CleanupNode func(p0 context.Context, p1 string, p2 string) error `perm:"web,admin"`
CreateTunnel func(p0 context.Context, p1 *types.CreateTunnelReq) error `perm:"candidate"`
DeactivateNode func(p0 context.Context, p1 string, p2 int) error `perm:"web,admin,candidate"`
DeactivateNodeV2 func(p0 context.Context, p1 string, p2 int, p3 float64) error `perm:"web,admin,candidate"`
DownloadDataResult func(p0 context.Context, p1 string, p2 string, p3 int64) error `perm:"edge,candidate"`
EdgeConnect func(p0 context.Context, p1 *types.ConnectOptions) error `perm:"edge"`
ForceNodeOffline func(p0 context.Context, p1 string, p2 bool) error `perm:"web,admin"`
FreeUpDiskSpace func(p0 context.Context, p1 string, p2 int64) (*types.FreeUpDiskResp, error) `perm:"edge,candidate,admin"`
GetAssetSourceDownloadInfo func(p0 context.Context, p1 string) (*types.AssetSourceDownloadInfoRsp, error) `perm:"edge,candidate,web,locator"`
GetAssetView func(p0 context.Context, p1 string, p2 bool) (*types.AssetView, error) `perm:"admin"`
GetAssetsInBucket func(p0 context.Context, p1 string, p2 int, p3 bool) ([]string, error) `perm:"admin"`
GetCandidateDownloadInfos func(p0 context.Context, p1 string) ([]*types.CandidateDownloadInfo, error) `perm:"edge,candidate,web,locator"`
GetCandidateIPs func(p0 context.Context) ([]*types.NodeIPInfo, error) `perm:"web,user,admin"`
GetCandidateNodeIP func(p0 context.Context, p1 string) (string, error) `perm:"web,admin"`
GetCandidateURLsForDetectNat func(p0 context.Context) ([]string, error) `perm:"default"`
GetCurrentRegionInfos func(p0 context.Context, p1 string) (map[string]int, error) `perm:"web,admin"`
GetEdgeDownloadInfos func(p0 context.Context, p1 string) (*types.EdgeDownloadInfoList, error) `perm:"default"`
GetEdgeExternalServiceAddress func(p0 context.Context, p1 string, p2 string) (string, error) `perm:"admin"`
GetExternalAddress func(p0 context.Context) (string, error) `perm:"default"`
GetMinioConfigFromCandidate func(p0 context.Context, p1 string) (*types.MinioConfig, error) `perm:"default"`
GetNextFreeTime func(p0 context.Context, p1 string) (int64, error) `perm:"edge,candidate,admin"`
GetNodeInfo func(p0 context.Context, p1 string) (*types.NodeInfo, error) `perm:"web,admin"`
GetNodeList func(p0 context.Context, p1 int, p2 int) (*types.ListNodesRsp, error) `perm:"web,admin"`
GetNodeOfIP func(p0 context.Context, p1 string) ([]string, error) `perm:"admin,web,locator"`
GetNodeOnlineState func(p0 context.Context) (bool, error) `perm:"edge"`
GetNodeToken func(p0 context.Context, p1 string) (string, error) `perm:"admin"`
GetNodesFromRegion func(p0 context.Context, p1 string) ([]*types.NodeInfo, error) `perm:"web,admin"`
GetOnlineNodeCount func(p0 context.Context, p1 types.NodeType) (int, error) `perm:"web,admin"`
GetProfitDetailsForNode func(p0 context.Context, p1 string, p2 int, p3 int, p4 []int) (*types.ListNodeProfitDetailsRsp, error) `perm:"web,admin"`
GetTunserverURLFromUser func(p0 context.Context, p1 *types.TunserverReq) (*types.TunserverRsp, error) `perm:"admin,web,locator"`
L3Connect func(p0 context.Context, p1 *types.ConnectOptions) error `perm:"edge"`
L5Connect func(p0 context.Context, p1 *types.ConnectOptions) error `perm:"l5"`
LoadNodeBandwidthScores func(p0 context.Context, p1 string, p2 time.Time, p3 time.Time, p4 int, p5 int) (*types.ListBandwidthScoreRsp, error) `perm:"user,web,admin"`
MigrateNodeIn func(p0 context.Context, p1 *types.NodeMigrateInfo) error `perm:"web,admin"`
MigrateNodeOut func(p0 context.Context, p1 string) (*types.NodeMigrateInfo, error) `perm:"web,admin"`
NatPunch func(p0 context.Context, p1 *types.NatPunchReq) error `perm:"default"`
NodeExists func(p0 context.Context, p1 string) error `perm:"web"`
NodeKeepalive func(p0 context.Context) (*types.KeepaliveRsp, error) `perm:"edge,candidate"`
NodeKeepaliveV2 func(p0 context.Context) (uuid.UUID, error) `perm:"edge,candidate,l5"`
NodeKeepaliveV3 func(p0 context.Context, p1 *types.KeepaliveReq) (*types.KeepaliveRsp, error) `perm:"edge,candidate,l5"`
NodeLogin func(p0 context.Context, p1 string, p2 string) (string, error) `perm:"default"`
PerformSyncData func(p0 context.Context, p1 string) error `perm:"admin"`
ReDetermineNodeNATType func(p0 context.Context, p1 string) error `perm:"admin,web,locator"`
RecompenseNodeProfit func(p0 context.Context, p1 string, p2 string, p3 float64) error `perm:"admin,web,locator"`
RegisterCandidateNode func(p0 context.Context, p1 string, p2 string, p3 string) (*types.ActivationDetail, error) `perm:"default"`
RegisterEdgeNode func(p0 context.Context, p1 string, p2 string) (*types.ActivationDetail, error) `perm:"default"`
RegisterNode func(p0 context.Context, p1 string, p2 string, p3 types.NodeType) (*types.ActivationDetail, error) `perm:"default"`
RegisterNodeV2 func(p0 context.Context, p1 types.NodeRegister) (*types.ActivationDetail, error) `perm:"default"`
RequestActivationCodes func(p0 context.Context, p1 types.NodeType, p2 int) ([]*types.NodeActivation, error) `perm:"web,admin"`
SetTunserverURL func(p0 context.Context, p1 string, p2 string) error `perm:"admin,web,locator"`
UndoNodeDeactivation func(p0 context.Context, p1 string) error `perm:"web,admin"`
UpdateBandwidths func(p0 context.Context, p1 int64, p2 int64) error `perm:"edge,candidate"`
UpdateNodePort func(p0 context.Context, p1 string, p2 string) error `perm:"web,admin"`
UserAssetDownloadResultV2 func(p0 context.Context, p1 *types.RetrieveEvent) error `perm:"candidate"`
VerifyTokenWithLimitCount func(p0 context.Context, p1 string) (*types.JWTPayload, error) `perm:"edge,candidate"`
}
}
func (*NodeAPIStruct) CalculateDowntimePenalty ¶ added in v0.1.22
func (s *NodeAPIStruct) CalculateDowntimePenalty(p0 context.Context, p1 string) (types.ExitProfitRsp, error)
func (*NodeAPIStruct) CalculateExitProfit ¶ added in v0.1.19
func (s *NodeAPIStruct) CalculateExitProfit(p0 context.Context, p1 string) (types.ExitProfitRsp, error)
func (*NodeAPIStruct) CandidateConnect ¶ added in v0.1.10
func (s *NodeAPIStruct) CandidateConnect(p0 context.Context, p1 *types.ConnectOptions) error
func (*NodeAPIStruct) CheckIpUsage ¶ added in v0.1.14
func (*NodeAPIStruct) CleanupNode ¶ added in v0.1.22
func (*NodeAPIStruct) CreateTunnel ¶ added in v0.1.21
func (s *NodeAPIStruct) CreateTunnel(p0 context.Context, p1 *types.CreateTunnelReq) error
func (*NodeAPIStruct) DeactivateNode ¶ added in v0.1.11
func (*NodeAPIStruct) DeactivateNodeV2 ¶ added in v0.1.23
func (*NodeAPIStruct) DownloadDataResult ¶ added in v0.1.13
func (*NodeAPIStruct) EdgeConnect ¶ added in v0.1.10
func (s *NodeAPIStruct) EdgeConnect(p0 context.Context, p1 *types.ConnectOptions) error
func (*NodeAPIStruct) ForceNodeOffline ¶ added in v0.1.22
func (*NodeAPIStruct) FreeUpDiskSpace ¶ added in v0.1.19
func (s *NodeAPIStruct) FreeUpDiskSpace(p0 context.Context, p1 string, p2 int64) (*types.FreeUpDiskResp, error)
func (*NodeAPIStruct) GetAssetSourceDownloadInfo ¶ added in v0.1.18
func (s *NodeAPIStruct) GetAssetSourceDownloadInfo(p0 context.Context, p1 string) (*types.AssetSourceDownloadInfoRsp, error)
func (*NodeAPIStruct) GetAssetView ¶ added in v0.1.14
func (*NodeAPIStruct) GetAssetsInBucket ¶ added in v0.1.14
func (*NodeAPIStruct) GetCandidateDownloadInfos ¶ added in v0.1.10
func (s *NodeAPIStruct) GetCandidateDownloadInfos(p0 context.Context, p1 string) ([]*types.CandidateDownloadInfo, error)
func (*NodeAPIStruct) GetCandidateIPs ¶ added in v0.1.11
func (s *NodeAPIStruct) GetCandidateIPs(p0 context.Context) ([]*types.NodeIPInfo, error)
func (*NodeAPIStruct) GetCandidateNodeIP ¶ added in v0.1.11
func (*NodeAPIStruct) GetCandidateURLsForDetectNat ¶ added in v0.1.10
func (s *NodeAPIStruct) GetCandidateURLsForDetectNat(p0 context.Context) ([]string, error)
func (*NodeAPIStruct) GetCurrentRegionInfos ¶ added in v0.1.19
func (*NodeAPIStruct) GetEdgeDownloadInfos ¶ added in v0.1.10
func (s *NodeAPIStruct) GetEdgeDownloadInfos(p0 context.Context, p1 string) (*types.EdgeDownloadInfoList, error)
func (*NodeAPIStruct) GetEdgeExternalServiceAddress ¶ added in v0.1.10
func (*NodeAPIStruct) GetExternalAddress ¶ added in v0.1.10
func (s *NodeAPIStruct) GetExternalAddress(p0 context.Context) (string, error)
func (*NodeAPIStruct) GetMinioConfigFromCandidate ¶ added in v0.1.11
func (s *NodeAPIStruct) GetMinioConfigFromCandidate(p0 context.Context, p1 string) (*types.MinioConfig, error)
func (*NodeAPIStruct) GetNextFreeTime ¶ added in v0.1.19
func (*NodeAPIStruct) GetNodeInfo ¶ added in v0.1.10
func (*NodeAPIStruct) GetNodeList ¶ added in v0.1.10
func (s *NodeAPIStruct) GetNodeList(p0 context.Context, p1 int, p2 int) (*types.ListNodesRsp, error)
func (*NodeAPIStruct) GetNodeOfIP ¶ added in v0.1.15
func (*NodeAPIStruct) GetNodeOnlineState ¶ added in v0.1.13
func (s *NodeAPIStruct) GetNodeOnlineState(p0 context.Context) (bool, error)
func (*NodeAPIStruct) GetNodeToken ¶ added in v0.1.13
func (*NodeAPIStruct) GetNodesFromRegion ¶ added in v0.1.19
func (*NodeAPIStruct) GetOnlineNodeCount ¶ added in v0.1.10
func (*NodeAPIStruct) GetProfitDetailsForNode ¶ added in v0.1.18
func (s *NodeAPIStruct) GetProfitDetailsForNode(p0 context.Context, p1 string, p2 int, p3 int, p4 []int) (*types.ListNodeProfitDetailsRsp, error)
func (*NodeAPIStruct) GetTunserverURLFromUser ¶ added in v0.1.21
func (s *NodeAPIStruct) GetTunserverURLFromUser(p0 context.Context, p1 *types.TunserverReq) (*types.TunserverRsp, error)
func (*NodeAPIStruct) L3Connect ¶ added in v0.1.22
func (s *NodeAPIStruct) L3Connect(p0 context.Context, p1 *types.ConnectOptions) error
func (*NodeAPIStruct) L5Connect ¶ added in v0.1.21
func (s *NodeAPIStruct) L5Connect(p0 context.Context, p1 *types.ConnectOptions) error
func (*NodeAPIStruct) LoadNodeBandwidthScores ¶ added in v0.1.22
func (*NodeAPIStruct) MigrateNodeIn ¶ added in v0.1.22
func (s *NodeAPIStruct) MigrateNodeIn(p0 context.Context, p1 *types.NodeMigrateInfo) error
func (*NodeAPIStruct) MigrateNodeOut ¶ added in v0.1.22
func (s *NodeAPIStruct) MigrateNodeOut(p0 context.Context, p1 string) (*types.NodeMigrateInfo, error)
func (*NodeAPIStruct) NatPunch ¶ added in v0.1.10
func (s *NodeAPIStruct) NatPunch(p0 context.Context, p1 *types.NatPunchReq) error
func (*NodeAPIStruct) NodeExists ¶ added in v0.1.10
func (s *NodeAPIStruct) NodeExists(p0 context.Context, p1 string) error
func (*NodeAPIStruct) NodeKeepalive ¶ added in v0.1.10
func (s *NodeAPIStruct) NodeKeepalive(p0 context.Context) (*types.KeepaliveRsp, error)
func (*NodeAPIStruct) NodeKeepaliveV2 ¶ added in v0.1.11
func (*NodeAPIStruct) NodeKeepaliveV3 ¶ added in v0.1.22
func (s *NodeAPIStruct) NodeKeepaliveV3(p0 context.Context, p1 *types.KeepaliveReq) (*types.KeepaliveRsp, error)
func (*NodeAPIStruct) PerformSyncData ¶ added in v0.1.18
func (s *NodeAPIStruct) PerformSyncData(p0 context.Context, p1 string) error
func (*NodeAPIStruct) ReDetermineNodeNATType ¶ added in v0.1.19
func (s *NodeAPIStruct) ReDetermineNodeNATType(p0 context.Context, p1 string) error
func (*NodeAPIStruct) RecompenseNodeProfit ¶ added in v0.1.22
func (*NodeAPIStruct) RegisterCandidateNode ¶ added in v0.1.19
func (s *NodeAPIStruct) RegisterCandidateNode(p0 context.Context, p1 string, p2 string, p3 string) (*types.ActivationDetail, error)
func (*NodeAPIStruct) RegisterEdgeNode ¶ added in v0.1.11
func (s *NodeAPIStruct) RegisterEdgeNode(p0 context.Context, p1 string, p2 string) (*types.ActivationDetail, error)
func (*NodeAPIStruct) RegisterNode ¶ added in v0.1.10
func (s *NodeAPIStruct) RegisterNode(p0 context.Context, p1 string, p2 string, p3 types.NodeType) (*types.ActivationDetail, error)
func (*NodeAPIStruct) RegisterNodeV2 ¶ added in v0.1.22
func (s *NodeAPIStruct) RegisterNodeV2(p0 context.Context, p1 types.NodeRegister) (*types.ActivationDetail, error)
func (*NodeAPIStruct) RequestActivationCodes ¶ added in v0.1.10
func (s *NodeAPIStruct) RequestActivationCodes(p0 context.Context, p1 types.NodeType, p2 int) ([]*types.NodeActivation, error)
func (*NodeAPIStruct) SetTunserverURL ¶ added in v0.1.21
func (*NodeAPIStruct) UndoNodeDeactivation ¶ added in v0.1.11
func (s *NodeAPIStruct) UndoNodeDeactivation(p0 context.Context, p1 string) error
func (*NodeAPIStruct) UpdateBandwidths ¶ added in v0.1.11
func (*NodeAPIStruct) UpdateNodePort ¶ added in v0.1.10
func (*NodeAPIStruct) UserAssetDownloadResultV2 ¶ added in v0.1.22
func (s *NodeAPIStruct) UserAssetDownloadResultV2(p0 context.Context, p1 *types.RetrieveEvent) error
func (*NodeAPIStruct) VerifyTokenWithLimitCount ¶ added in v0.1.11
func (s *NodeAPIStruct) VerifyTokenWithLimitCount(p0 context.Context, p1 string) (*types.JWTPayload, error)
type NodeAPIStub ¶ added in v0.1.10
type NodeAPIStub struct {
}
func (*NodeAPIStub) CalculateDowntimePenalty ¶ added in v0.1.22
func (s *NodeAPIStub) CalculateDowntimePenalty(p0 context.Context, p1 string) (types.ExitProfitRsp, error)
func (*NodeAPIStub) CalculateExitProfit ¶ added in v0.1.19
func (s *NodeAPIStub) CalculateExitProfit(p0 context.Context, p1 string) (types.ExitProfitRsp, error)
func (*NodeAPIStub) CandidateConnect ¶ added in v0.1.10
func (s *NodeAPIStub) CandidateConnect(p0 context.Context, p1 *types.ConnectOptions) error
func (*NodeAPIStub) CheckIpUsage ¶ added in v0.1.14
func (*NodeAPIStub) CleanupNode ¶ added in v0.1.22
func (*NodeAPIStub) CreateTunnel ¶ added in v0.1.21
func (s *NodeAPIStub) CreateTunnel(p0 context.Context, p1 *types.CreateTunnelReq) error
func (*NodeAPIStub) DeactivateNode ¶ added in v0.1.11
func (*NodeAPIStub) DeactivateNodeV2 ¶ added in v0.1.23
func (*NodeAPIStub) DownloadDataResult ¶ added in v0.1.13
func (*NodeAPIStub) EdgeConnect ¶ added in v0.1.10
func (s *NodeAPIStub) EdgeConnect(p0 context.Context, p1 *types.ConnectOptions) error
func (*NodeAPIStub) ForceNodeOffline ¶ added in v0.1.22
func (*NodeAPIStub) FreeUpDiskSpace ¶ added in v0.1.19
func (s *NodeAPIStub) FreeUpDiskSpace(p0 context.Context, p1 string, p2 int64) (*types.FreeUpDiskResp, error)
func (*NodeAPIStub) GetAssetSourceDownloadInfo ¶ added in v0.1.18
func (s *NodeAPIStub) GetAssetSourceDownloadInfo(p0 context.Context, p1 string) (*types.AssetSourceDownloadInfoRsp, error)
func (*NodeAPIStub) GetAssetView ¶ added in v0.1.14
func (*NodeAPIStub) GetAssetsInBucket ¶ added in v0.1.14
func (*NodeAPIStub) GetCandidateDownloadInfos ¶ added in v0.1.10
func (s *NodeAPIStub) GetCandidateDownloadInfos(p0 context.Context, p1 string) ([]*types.CandidateDownloadInfo, error)
func (*NodeAPIStub) GetCandidateIPs ¶ added in v0.1.11
func (s *NodeAPIStub) GetCandidateIPs(p0 context.Context) ([]*types.NodeIPInfo, error)
func (*NodeAPIStub) GetCandidateNodeIP ¶ added in v0.1.11
func (*NodeAPIStub) GetCandidateURLsForDetectNat ¶ added in v0.1.10
func (s *NodeAPIStub) GetCandidateURLsForDetectNat(p0 context.Context) ([]string, error)
func (*NodeAPIStub) GetCurrentRegionInfos ¶ added in v0.1.19
func (*NodeAPIStub) GetEdgeDownloadInfos ¶ added in v0.1.10
func (s *NodeAPIStub) GetEdgeDownloadInfos(p0 context.Context, p1 string) (*types.EdgeDownloadInfoList, error)
func (*NodeAPIStub) GetEdgeExternalServiceAddress ¶ added in v0.1.10
func (*NodeAPIStub) GetExternalAddress ¶ added in v0.1.10
func (s *NodeAPIStub) GetExternalAddress(p0 context.Context) (string, error)
func (*NodeAPIStub) GetMinioConfigFromCandidate ¶ added in v0.1.11
func (s *NodeAPIStub) GetMinioConfigFromCandidate(p0 context.Context, p1 string) (*types.MinioConfig, error)
func (*NodeAPIStub) GetNextFreeTime ¶ added in v0.1.19
func (*NodeAPIStub) GetNodeInfo ¶ added in v0.1.10
func (*NodeAPIStub) GetNodeList ¶ added in v0.1.10
func (s *NodeAPIStub) GetNodeList(p0 context.Context, p1 int, p2 int) (*types.ListNodesRsp, error)
func (*NodeAPIStub) GetNodeOfIP ¶ added in v0.1.15
func (*NodeAPIStub) GetNodeOnlineState ¶ added in v0.1.13
func (s *NodeAPIStub) GetNodeOnlineState(p0 context.Context) (bool, error)
func (*NodeAPIStub) GetNodeToken ¶ added in v0.1.13
func (*NodeAPIStub) GetNodesFromRegion ¶ added in v0.1.19
func (*NodeAPIStub) GetOnlineNodeCount ¶ added in v0.1.10
func (*NodeAPIStub) GetProfitDetailsForNode ¶ added in v0.1.18
func (s *NodeAPIStub) GetProfitDetailsForNode(p0 context.Context, p1 string, p2 int, p3 int, p4 []int) (*types.ListNodeProfitDetailsRsp, error)
func (*NodeAPIStub) GetTunserverURLFromUser ¶ added in v0.1.21
func (s *NodeAPIStub) GetTunserverURLFromUser(p0 context.Context, p1 *types.TunserverReq) (*types.TunserverRsp, error)
func (*NodeAPIStub) L3Connect ¶ added in v0.1.22
func (s *NodeAPIStub) L3Connect(p0 context.Context, p1 *types.ConnectOptions) error
func (*NodeAPIStub) L5Connect ¶ added in v0.1.21
func (s *NodeAPIStub) L5Connect(p0 context.Context, p1 *types.ConnectOptions) error
func (*NodeAPIStub) LoadNodeBandwidthScores ¶ added in v0.1.22
func (*NodeAPIStub) MigrateNodeIn ¶ added in v0.1.22
func (s *NodeAPIStub) MigrateNodeIn(p0 context.Context, p1 *types.NodeMigrateInfo) error
func (*NodeAPIStub) MigrateNodeOut ¶ added in v0.1.22
func (s *NodeAPIStub) MigrateNodeOut(p0 context.Context, p1 string) (*types.NodeMigrateInfo, error)
func (*NodeAPIStub) NatPunch ¶ added in v0.1.10
func (s *NodeAPIStub) NatPunch(p0 context.Context, p1 *types.NatPunchReq) error
func (*NodeAPIStub) NodeExists ¶ added in v0.1.10
func (s *NodeAPIStub) NodeExists(p0 context.Context, p1 string) error
func (*NodeAPIStub) NodeKeepalive ¶ added in v0.1.10
func (s *NodeAPIStub) NodeKeepalive(p0 context.Context) (*types.KeepaliveRsp, error)
func (*NodeAPIStub) NodeKeepaliveV2 ¶ added in v0.1.11
func (*NodeAPIStub) NodeKeepaliveV3 ¶ added in v0.1.22
func (s *NodeAPIStub) NodeKeepaliveV3(p0 context.Context, p1 *types.KeepaliveReq) (*types.KeepaliveRsp, error)
func (*NodeAPIStub) PerformSyncData ¶ added in v0.1.18
func (s *NodeAPIStub) PerformSyncData(p0 context.Context, p1 string) error
func (*NodeAPIStub) ReDetermineNodeNATType ¶ added in v0.1.19
func (s *NodeAPIStub) ReDetermineNodeNATType(p0 context.Context, p1 string) error
func (*NodeAPIStub) RecompenseNodeProfit ¶ added in v0.1.22
func (*NodeAPIStub) RegisterCandidateNode ¶ added in v0.1.19
func (s *NodeAPIStub) RegisterCandidateNode(p0 context.Context, p1 string, p2 string, p3 string) (*types.ActivationDetail, error)
func (*NodeAPIStub) RegisterEdgeNode ¶ added in v0.1.11
func (s *NodeAPIStub) RegisterEdgeNode(p0 context.Context, p1 string, p2 string) (*types.ActivationDetail, error)
func (*NodeAPIStub) RegisterNode ¶ added in v0.1.10
func (s *NodeAPIStub) RegisterNode(p0 context.Context, p1 string, p2 string, p3 types.NodeType) (*types.ActivationDetail, error)
func (*NodeAPIStub) RegisterNodeV2 ¶ added in v0.1.22
func (s *NodeAPIStub) RegisterNodeV2(p0 context.Context, p1 types.NodeRegister) (*types.ActivationDetail, error)
func (*NodeAPIStub) RequestActivationCodes ¶ added in v0.1.10
func (s *NodeAPIStub) RequestActivationCodes(p0 context.Context, p1 types.NodeType, p2 int) ([]*types.NodeActivation, error)
func (*NodeAPIStub) SetTunserverURL ¶ added in v0.1.21
func (*NodeAPIStub) UndoNodeDeactivation ¶ added in v0.1.11
func (s *NodeAPIStub) UndoNodeDeactivation(p0 context.Context, p1 string) error
func (*NodeAPIStub) UpdateBandwidths ¶ added in v0.1.11
func (*NodeAPIStub) UpdateNodePort ¶ added in v0.1.10
func (*NodeAPIStub) UserAssetDownloadResultV2 ¶ added in v0.1.22
func (s *NodeAPIStub) UserAssetDownloadResultV2(p0 context.Context, p1 *types.RetrieveEvent) error
func (*NodeAPIStub) VerifyTokenWithLimitCount ¶ added in v0.1.11
func (s *NodeAPIStub) VerifyTokenWithLimitCount(p0 context.Context, p1 string) (*types.JWTPayload, error)
type ProjectAPI ¶ added in v0.1.19
type ProjectAPI interface {
// RedeployFailedProjects retries the pull process for a list of failed assets
RedeployFailedProjects(ctx context.Context, ids []string) error //perm:admin
// UpdateProjectStatus
UpdateProjectStatus(ctx context.Context, list []*types.Project) error //perm:edge,candidate
// GetProjectsForNode
GetProjectsForNode(ctx context.Context, nodeID string) ([]*types.ProjectReplicas, error) //perm:edge,candidate,web,locator
DeployProject(ctx context.Context, req *types.DeployProjectReq) error //perm:user,web,admin
DeleteProject(ctx context.Context, req *types.ProjectReq) error //perm:user,web,admin
UpdateProject(ctx context.Context, req *types.ProjectReq) error //perm:user,web,admin
GetProjectInfo(ctx context.Context, uuid string) (*types.ProjectInfo, error) //perm:user,web,admin
GetProjectInfos(ctx context.Context, user string, limit, offset int) ([]*types.ProjectInfo, error) //perm:user,web,admin
GetProjectOverviewByNode(ctx context.Context, req *types.NodeProjectReq) (*types.ListProjectOverviewRsp, error) //perm:web,admin
GetProjectReplicasForNode(ctx context.Context, req *types.NodeProjectReq) (*types.ListProjectReplicaRsp, error) //perm:web,admin
}
ProjectAPI is an interface for project
type ProjectAPIStruct ¶ added in v0.1.19
type ProjectAPIStruct struct {
Internal struct {
DeleteProject func(p0 context.Context, p1 *types.ProjectReq) error `perm:"user,web,admin"`
DeployProject func(p0 context.Context, p1 *types.DeployProjectReq) error `perm:"user,web,admin"`
GetProjectInfo func(p0 context.Context, p1 string) (*types.ProjectInfo, error) `perm:"user,web,admin"`
GetProjectInfos func(p0 context.Context, p1 string, p2 int, p3 int) ([]*types.ProjectInfo, error) `perm:"user,web,admin"`
GetProjectOverviewByNode func(p0 context.Context, p1 *types.NodeProjectReq) (*types.ListProjectOverviewRsp, error) `perm:"web,admin"`
GetProjectReplicasForNode func(p0 context.Context, p1 *types.NodeProjectReq) (*types.ListProjectReplicaRsp, error) `perm:"web,admin"`
GetProjectsForNode func(p0 context.Context, p1 string) ([]*types.ProjectReplicas, error) `perm:"edge,candidate,web,locator"`
RedeployFailedProjects func(p0 context.Context, p1 []string) error `perm:"admin"`
UpdateProject func(p0 context.Context, p1 *types.ProjectReq) error `perm:"user,web,admin"`
UpdateProjectStatus func(p0 context.Context, p1 []*types.Project) error `perm:"edge,candidate"`
}
}
func (*ProjectAPIStruct) DeleteProject ¶ added in v0.1.19
func (s *ProjectAPIStruct) DeleteProject(p0 context.Context, p1 *types.ProjectReq) error
func (*ProjectAPIStruct) DeployProject ¶ added in v0.1.19
func (s *ProjectAPIStruct) DeployProject(p0 context.Context, p1 *types.DeployProjectReq) error
func (*ProjectAPIStruct) GetProjectInfo ¶ added in v0.1.19
func (s *ProjectAPIStruct) GetProjectInfo(p0 context.Context, p1 string) (*types.ProjectInfo, error)
func (*ProjectAPIStruct) GetProjectInfos ¶ added in v0.1.19
func (s *ProjectAPIStruct) GetProjectInfos(p0 context.Context, p1 string, p2 int, p3 int) ([]*types.ProjectInfo, error)
func (*ProjectAPIStruct) GetProjectOverviewByNode ¶ added in v0.1.22
func (s *ProjectAPIStruct) GetProjectOverviewByNode(p0 context.Context, p1 *types.NodeProjectReq) (*types.ListProjectOverviewRsp, error)
func (*ProjectAPIStruct) GetProjectReplicasForNode ¶ added in v0.1.22
func (s *ProjectAPIStruct) GetProjectReplicasForNode(p0 context.Context, p1 *types.NodeProjectReq) (*types.ListProjectReplicaRsp, error)
func (*ProjectAPIStruct) GetProjectsForNode ¶ added in v0.1.19
func (s *ProjectAPIStruct) GetProjectsForNode(p0 context.Context, p1 string) ([]*types.ProjectReplicas, error)
func (*ProjectAPIStruct) RedeployFailedProjects ¶ added in v0.1.19
func (s *ProjectAPIStruct) RedeployFailedProjects(p0 context.Context, p1 []string) error
func (*ProjectAPIStruct) UpdateProject ¶ added in v0.1.19
func (s *ProjectAPIStruct) UpdateProject(p0 context.Context, p1 *types.ProjectReq) error
func (*ProjectAPIStruct) UpdateProjectStatus ¶ added in v0.1.19
type ProjectAPIStub ¶ added in v0.1.19
type ProjectAPIStub struct {
}
func (*ProjectAPIStub) DeleteProject ¶ added in v0.1.19
func (s *ProjectAPIStub) DeleteProject(p0 context.Context, p1 *types.ProjectReq) error
func (*ProjectAPIStub) DeployProject ¶ added in v0.1.19
func (s *ProjectAPIStub) DeployProject(p0 context.Context, p1 *types.DeployProjectReq) error
func (*ProjectAPIStub) GetProjectInfo ¶ added in v0.1.19
func (s *ProjectAPIStub) GetProjectInfo(p0 context.Context, p1 string) (*types.ProjectInfo, error)
func (*ProjectAPIStub) GetProjectInfos ¶ added in v0.1.19
func (s *ProjectAPIStub) GetProjectInfos(p0 context.Context, p1 string, p2 int, p3 int) ([]*types.ProjectInfo, error)
func (*ProjectAPIStub) GetProjectOverviewByNode ¶ added in v0.1.22
func (s *ProjectAPIStub) GetProjectOverviewByNode(p0 context.Context, p1 *types.NodeProjectReq) (*types.ListProjectOverviewRsp, error)
func (*ProjectAPIStub) GetProjectReplicasForNode ¶ added in v0.1.22
func (s *ProjectAPIStub) GetProjectReplicasForNode(p0 context.Context, p1 *types.NodeProjectReq) (*types.ListProjectReplicaRsp, error)
func (*ProjectAPIStub) GetProjectsForNode ¶ added in v0.1.19
func (s *ProjectAPIStub) GetProjectsForNode(p0 context.Context, p1 string) ([]*types.ProjectReplicas, error)
func (*ProjectAPIStub) RedeployFailedProjects ¶ added in v0.1.19
func (s *ProjectAPIStub) RedeployFailedProjects(p0 context.Context, p1 []string) error
func (*ProjectAPIStub) UpdateProject ¶ added in v0.1.19
func (s *ProjectAPIStub) UpdateProject(p0 context.Context, p1 *types.ProjectReq) error
func (*ProjectAPIStub) UpdateProjectStatus ¶ added in v0.1.19
type Scheduler ¶
type Scheduler interface {
Common
AssetAPI
NodeAPI
ProjectAPI
// NodeValidationResult processes the validation result for a node
NodeValidationResult(ctx context.Context, r io.Reader, sign string) error //perm:edge,candidate
// GetValidationResults retrieves a list of validation results with pagination using the specified node, page number, and page size
GetValidationResults(ctx context.Context, nodeID string, limit, offset int) (*types.ListValidationResultRsp, error) //perm:web,admin
// SubmitProjectReport
SubmitProjectReport(ctx context.Context, req *types.ProjectRecordReq) error //perm:candidate
// SubmitWorkloadReport
SubmitWorkloadReport(ctx context.Context, workload *types.WorkloadRecordReq) error //perm:default
// SubmitWorkloadReportV2
SubmitWorkloadReportV2(ctx context.Context, workload *types.WorkloadRecordReq) error //perm:default
// GetWorkloadRecords retrieves a list of workload results with pagination using the specified limit, offset, and node
GetWorkloadRecords(ctx context.Context, nodeID string, limit, offset int) (*types.ListWorkloadRecordRsp, error) //perm:web,admin
// GetWorkloadRecord retrieves a list of workload results with pagination using the specified limit, offset, and node
GetWorkloadRecord(ctx context.Context, id string) (*types.WorkloadRecord, error) //perm:web,admin
// Server-related methods
// GetSchedulerPublicKey retrieves the scheduler's public key in PEM format
GetSchedulerPublicKey(ctx context.Context) (string, error) //perm:edge,candidate
// GetNodePublicKey retrieves the node's public key in PEM format
GetNodePublicKey(ctx context.Context, nodeID string) (string, error) //perm:web,admin
// GetEdgeUpdateConfigs retrieves edge update configurations for different node types
GetEdgeUpdateConfigs(ctx context.Context) (map[int]*EdgeUpdateConfig, error) //perm:edge
// SetEdgeUpdateConfig updates the edge update configuration for a specific node type with the provided information
SetEdgeUpdateConfig(ctx context.Context, info *EdgeUpdateConfig) error //perm:admin
// DeleteEdgeUpdateConfig deletes the edge update configuration for the specified node type
DeleteEdgeUpdateConfig(ctx context.Context, nodeType int) error //perm:admin
// code
// GenerateCandidateCodes
GenerateCandidateCodes(ctx context.Context, count int, nodeType types.NodeType, isTest bool) ([]string, error) //perm:admin
// CandidateCodeExist
CandidateCodeExist(ctx context.Context, code string) (bool, error) //perm:admin,web,locator
// GetCandidateCodeInfos
GetCandidateCodeInfos(ctx context.Context, nodeID, code string) ([]*types.CandidateCodeInfo, error) //perm:admin,web,locator
ResetCandidateCode(ctx context.Context, nodeID, code string) error //perm:admin,web,locator
RemoveCandidateCode(ctx context.Context, code string) error //perm:admin,web,locator
// GetNodeUploadInfo
GetNodeUploadInfoV2(ctx context.Context, info *types.GetUploadInfoReq) (*types.UploadInfo, error) //perm:user,web,admin
GetValidators(ctx context.Context) ([]string, error) //perm:web,admin
GetReplicaEvents(ctx context.Context, start, end time.Time, limit, offset int) (*types.ListAssetReplicaEventRsp, error) //perm:web,admin
AddNodeServiceEvent(ctx context.Context, event *types.ServiceEvent) error //perm:web,admin
// Deprecated api
// AssignTunserverURL
AssignTunserverURL(ctx context.Context) (*types.TunserverRsp, error) //perm:edge
GetNodeUploadInfo(ctx context.Context, userID string, pass string, urlMode bool) (*types.UploadInfo, error) //perm:user,web,admin
UserAssetDownloadResult(ctx context.Context, userID, cid string, totalTraffic, peakBandwidth int64) error //perm:candidate
GetDeploymentProviderIP(ctx context.Context, id types.DeploymentID) (string, error) //perm:edge,candidate,web,locator,admin
}
Scheduler is an interface for scheduler
type SchedulerStruct ¶
type SchedulerStruct struct {
CommonStruct
AssetAPIStruct
NodeAPIStruct
ProjectAPIStruct
Internal struct {
AddNodeServiceEvent func(p0 context.Context, p1 *types.ServiceEvent) error `perm:"web,admin"`
AssignTunserverURL func(p0 context.Context) (*types.TunserverRsp, error) `perm:"edge"`
CandidateCodeExist func(p0 context.Context, p1 string) (bool, error) `perm:"admin,web,locator"`
DeleteEdgeUpdateConfig func(p0 context.Context, p1 int) error `perm:"admin"`
GenerateCandidateCodes func(p0 context.Context, p1 int, p2 types.NodeType, p3 bool) ([]string, error) `perm:"admin"`
GetCandidateCodeInfos func(p0 context.Context, p1 string, p2 string) ([]*types.CandidateCodeInfo, error) `perm:"admin,web,locator"`
GetDeploymentProviderIP func(p0 context.Context, p1 types.DeploymentID) (string, error) `perm:"edge,candidate,web,locator,admin"`
GetEdgeUpdateConfigs func(p0 context.Context) (map[int]*EdgeUpdateConfig, error) `perm:"edge"`
GetNodePublicKey func(p0 context.Context, p1 string) (string, error) `perm:"web,admin"`
GetNodeUploadInfo func(p0 context.Context, p1 string, p2 string, p3 bool) (*types.UploadInfo, error) `perm:"user,web,admin"`
GetNodeUploadInfoV2 func(p0 context.Context, p1 *types.GetUploadInfoReq) (*types.UploadInfo, error) `perm:"user,web,admin"`
GetReplicaEvents func(p0 context.Context, p1 time.Time, p2 time.Time, p3 int, p4 int) (*types.ListAssetReplicaEventRsp, error) `perm:"web,admin"`
GetSchedulerPublicKey func(p0 context.Context) (string, error) `perm:"edge,candidate"`
GetValidationResults func(p0 context.Context, p1 string, p2 int, p3 int) (*types.ListValidationResultRsp, error) `perm:"web,admin"`
GetValidators func(p0 context.Context) ([]string, error) `perm:"web,admin"`
GetWorkloadRecord func(p0 context.Context, p1 string) (*types.WorkloadRecord, error) `perm:"web,admin"`
GetWorkloadRecords func(p0 context.Context, p1 string, p2 int, p3 int) (*types.ListWorkloadRecordRsp, error) `perm:"web,admin"`
NodeValidationResult func(p0 context.Context, p1 io.Reader, p2 string) error `perm:"edge,candidate"`
RemoveCandidateCode func(p0 context.Context, p1 string) error `perm:"admin,web,locator"`
ResetCandidateCode func(p0 context.Context, p1 string, p2 string) error `perm:"admin,web,locator"`
SetEdgeUpdateConfig func(p0 context.Context, p1 *EdgeUpdateConfig) error `perm:"admin"`
SubmitProjectReport func(p0 context.Context, p1 *types.ProjectRecordReq) error `perm:"candidate"`
SubmitWorkloadReport func(p0 context.Context, p1 *types.WorkloadRecordReq) error `perm:"default"`
SubmitWorkloadReportV2 func(p0 context.Context, p1 *types.WorkloadRecordReq) error `perm:"default"`
UserAssetDownloadResult func(p0 context.Context, p1 string, p2 string, p3 int64, p4 int64) error `perm:"candidate"`
}
}
func (*SchedulerStruct) AddNodeServiceEvent ¶ added in v0.1.22
func (s *SchedulerStruct) AddNodeServiceEvent(p0 context.Context, p1 *types.ServiceEvent) error
func (*SchedulerStruct) AssignTunserverURL ¶ added in v0.1.22
func (s *SchedulerStruct) AssignTunserverURL(p0 context.Context) (*types.TunserverRsp, error)
func (*SchedulerStruct) CandidateCodeExist ¶ added in v0.1.21
func (*SchedulerStruct) DeleteEdgeUpdateConfig ¶
func (s *SchedulerStruct) DeleteEdgeUpdateConfig(p0 context.Context, p1 int) error
func (*SchedulerStruct) GenerateCandidateCodes ¶ added in v0.1.21
func (*SchedulerStruct) GetCandidateCodeInfos ¶ added in v0.1.21
func (s *SchedulerStruct) GetCandidateCodeInfos(p0 context.Context, p1 string, p2 string) ([]*types.CandidateCodeInfo, error)
func (*SchedulerStruct) GetDeploymentProviderIP ¶ added in v0.1.22
func (s *SchedulerStruct) GetDeploymentProviderIP(p0 context.Context, p1 types.DeploymentID) (string, error)
func (*SchedulerStruct) GetEdgeUpdateConfigs ¶
func (s *SchedulerStruct) GetEdgeUpdateConfigs(p0 context.Context) (map[int]*EdgeUpdateConfig, error)
func (*SchedulerStruct) GetNodePublicKey ¶ added in v0.1.11
func (*SchedulerStruct) GetNodeUploadInfo ¶ added in v0.1.22
func (s *SchedulerStruct) GetNodeUploadInfo(p0 context.Context, p1 string, p2 string, p3 bool) (*types.UploadInfo, error)
func (*SchedulerStruct) GetNodeUploadInfoV2 ¶ added in v0.1.22
func (s *SchedulerStruct) GetNodeUploadInfoV2(p0 context.Context, p1 *types.GetUploadInfoReq) (*types.UploadInfo, error)
func (*SchedulerStruct) GetReplicaEvents ¶ added in v0.1.22
func (*SchedulerStruct) GetSchedulerPublicKey ¶
func (s *SchedulerStruct) GetSchedulerPublicKey(p0 context.Context) (string, error)
func (*SchedulerStruct) GetValidationResults ¶
func (s *SchedulerStruct) GetValidationResults(p0 context.Context, p1 string, p2 int, p3 int) (*types.ListValidationResultRsp, error)
func (*SchedulerStruct) GetValidators ¶ added in v0.1.22
func (s *SchedulerStruct) GetValidators(p0 context.Context) ([]string, error)
func (*SchedulerStruct) GetWorkloadRecord ¶ added in v0.1.10
func (s *SchedulerStruct) GetWorkloadRecord(p0 context.Context, p1 string) (*types.WorkloadRecord, error)
func (*SchedulerStruct) GetWorkloadRecords ¶ added in v0.1.10
func (s *SchedulerStruct) GetWorkloadRecords(p0 context.Context, p1 string, p2 int, p3 int) (*types.ListWorkloadRecordRsp, error)
func (*SchedulerStruct) NodeValidationResult ¶
func (*SchedulerStruct) RemoveCandidateCode ¶ added in v0.1.21
func (s *SchedulerStruct) RemoveCandidateCode(p0 context.Context, p1 string) error
func (*SchedulerStruct) ResetCandidateCode ¶ added in v0.1.21
func (*SchedulerStruct) SetEdgeUpdateConfig ¶
func (s *SchedulerStruct) SetEdgeUpdateConfig(p0 context.Context, p1 *EdgeUpdateConfig) error
func (*SchedulerStruct) SubmitProjectReport ¶ added in v0.1.21
func (s *SchedulerStruct) SubmitProjectReport(p0 context.Context, p1 *types.ProjectRecordReq) error
func (*SchedulerStruct) SubmitWorkloadReport ¶ added in v0.1.18
func (s *SchedulerStruct) SubmitWorkloadReport(p0 context.Context, p1 *types.WorkloadRecordReq) error
func (*SchedulerStruct) SubmitWorkloadReportV2 ¶ added in v0.1.18
func (s *SchedulerStruct) SubmitWorkloadReportV2(p0 context.Context, p1 *types.WorkloadRecordReq) error
func (*SchedulerStruct) UserAssetDownloadResult ¶ added in v0.1.22
type SchedulerStub ¶
type SchedulerStub struct {
CommonStub
AssetAPIStub
NodeAPIStub
ProjectAPIStub
}
func (*SchedulerStub) AddNodeServiceEvent ¶ added in v0.1.22
func (s *SchedulerStub) AddNodeServiceEvent(p0 context.Context, p1 *types.ServiceEvent) error
func (*SchedulerStub) AssignTunserverURL ¶ added in v0.1.22
func (s *SchedulerStub) AssignTunserverURL(p0 context.Context) (*types.TunserverRsp, error)
func (*SchedulerStub) CandidateCodeExist ¶ added in v0.1.21
func (*SchedulerStub) DeleteEdgeUpdateConfig ¶
func (s *SchedulerStub) DeleteEdgeUpdateConfig(p0 context.Context, p1 int) error
func (*SchedulerStub) GenerateCandidateCodes ¶ added in v0.1.21
func (*SchedulerStub) GetCandidateCodeInfos ¶ added in v0.1.21
func (s *SchedulerStub) GetCandidateCodeInfos(p0 context.Context, p1 string, p2 string) ([]*types.CandidateCodeInfo, error)
func (*SchedulerStub) GetDeploymentProviderIP ¶ added in v0.1.22
func (s *SchedulerStub) GetDeploymentProviderIP(p0 context.Context, p1 types.DeploymentID) (string, error)
func (*SchedulerStub) GetEdgeUpdateConfigs ¶
func (s *SchedulerStub) GetEdgeUpdateConfigs(p0 context.Context) (map[int]*EdgeUpdateConfig, error)
func (*SchedulerStub) GetNodePublicKey ¶ added in v0.1.11
func (*SchedulerStub) GetNodeUploadInfo ¶ added in v0.1.22
func (s *SchedulerStub) GetNodeUploadInfo(p0 context.Context, p1 string, p2 string, p3 bool) (*types.UploadInfo, error)
func (*SchedulerStub) GetNodeUploadInfoV2 ¶ added in v0.1.22
func (s *SchedulerStub) GetNodeUploadInfoV2(p0 context.Context, p1 *types.GetUploadInfoReq) (*types.UploadInfo, error)
func (*SchedulerStub) GetReplicaEvents ¶ added in v0.1.22
func (*SchedulerStub) GetSchedulerPublicKey ¶
func (s *SchedulerStub) GetSchedulerPublicKey(p0 context.Context) (string, error)
func (*SchedulerStub) GetValidationResults ¶
func (s *SchedulerStub) GetValidationResults(p0 context.Context, p1 string, p2 int, p3 int) (*types.ListValidationResultRsp, error)
func (*SchedulerStub) GetValidators ¶ added in v0.1.22
func (s *SchedulerStub) GetValidators(p0 context.Context) ([]string, error)
func (*SchedulerStub) GetWorkloadRecord ¶ added in v0.1.10
func (s *SchedulerStub) GetWorkloadRecord(p0 context.Context, p1 string) (*types.WorkloadRecord, error)
func (*SchedulerStub) GetWorkloadRecords ¶ added in v0.1.10
func (s *SchedulerStub) GetWorkloadRecords(p0 context.Context, p1 string, p2 int, p3 int) (*types.ListWorkloadRecordRsp, error)
func (*SchedulerStub) NodeValidationResult ¶
func (*SchedulerStub) RemoveCandidateCode ¶ added in v0.1.21
func (s *SchedulerStub) RemoveCandidateCode(p0 context.Context, p1 string) error
func (*SchedulerStub) ResetCandidateCode ¶ added in v0.1.21
func (*SchedulerStub) SetEdgeUpdateConfig ¶
func (s *SchedulerStub) SetEdgeUpdateConfig(p0 context.Context, p1 *EdgeUpdateConfig) error
func (*SchedulerStub) SubmitProjectReport ¶ added in v0.1.21
func (s *SchedulerStub) SubmitProjectReport(p0 context.Context, p1 *types.ProjectRecordReq) error
func (*SchedulerStub) SubmitWorkloadReport ¶ added in v0.1.18
func (s *SchedulerStub) SubmitWorkloadReport(p0 context.Context, p1 *types.WorkloadRecordReq) error
func (*SchedulerStub) SubmitWorkloadReportV2 ¶ added in v0.1.18
func (s *SchedulerStub) SubmitWorkloadReportV2(p0 context.Context, p1 *types.WorkloadRecordReq) error
func (*SchedulerStub) UserAssetDownloadResult ¶ added in v0.1.22
type TCPMsgType ¶
type TCPMsgType int
TODO: new tcp package, add these to tcp package candidate use tcp server to validate edge
const ( TCPMsgTypeNodeID TCPMsgType = iota + 1 TCPMsgTypeBlock TCPMsgTypeCancel )
type ValidateReq ¶
type ValidateReq struct {
// TCPSrvAddr Candidate tcp server address
TCPSrvAddr string
RandomSeed int64
Duration int
WSURL string
}
ValidateReq represents the request parameters for validation
type Validation ¶
type Validation interface {
// ExecuteValidation check node asset and bandwidth
ExecuteValidation(ctx context.Context, req *ValidateReq) error //perm:admin
}
Validation is an interface for validate-related operations
type ValidationResult ¶
type ValidationResult struct {
Validator string
CID string
// verification canceled due to download
IsCancel bool
NodeID string
Bandwidth float64
// seconds duration
CostTime int64
IsTimeout bool
// Msg string
// if IsCancel is true, Token is valid
// use for verify edge providing download
Token string
// key is random index
// values is cid
Cids []string
// The number of random for validator
RandomCount int
}
ValidationResult node Validation result
type ValidationStruct ¶
type ValidationStruct struct {
Internal struct {
ExecuteValidation func(p0 context.Context, p1 *ValidateReq) error `perm:"admin"`
}
}
func (*ValidationStruct) ExecuteValidation ¶
func (s *ValidationStruct) ExecuteValidation(p0 context.Context, p1 *ValidateReq) error
type ValidationStub ¶
type ValidationStub struct {
}
func (*ValidationStub) ExecuteValidation ¶
func (s *ValidationStub) ExecuteValidation(p0 context.Context, p1 *ValidateReq) error
type Version ¶
type Version uint32
func NewVerFromString ¶ added in v0.1.22
func (Version) EqMajorMinor ¶
type Workerd ¶ added in v0.1.19
type Workerd interface {
// Deploy deploy and run a project on workerd
Deploy(ctx context.Context, project *types.Project) error //perm:admin
// Update update the project on workerd
Update(ctx context.Context, project *types.Project) error //perm:admin
// Delete remove the project on workerd
Delete(ctx context.Context, projectID string) error //perm:admin
// Query projects
Query(ctx context.Context, ids []string) ([]*types.Project, error) //perm:admin
}
type WorkerdStruct ¶ added in v0.1.19
type WorkerdStruct struct {
Internal struct {
Delete func(p0 context.Context, p1 string) error `perm:"admin"`
Deploy func(p0 context.Context, p1 *types.Project) error `perm:"admin"`
Query func(p0 context.Context, p1 []string) ([]*types.Project, error) `perm:"admin"`
Update func(p0 context.Context, p1 *types.Project) error `perm:"admin"`
}
}
func (*WorkerdStruct) Delete ¶ added in v0.1.19
func (s *WorkerdStruct) Delete(p0 context.Context, p1 string) error