Documentation ¶
Index ¶
- func NewReleaser() *releaser
- type AWS
- type Asset
- func (a *Asset) AddAssetView(ctx context.Context, assetCIDs []string) error
- func (a *Asset) BlockCountOfAsset(assetCID string) (int, error)
- func (a *Asset) ClearFreeUpDisk(ctx context.Context) error
- func (a *Asset) CreateAsset(ctx context.Context, tokenPayload *types.AuthUserUploadDownloadAsset) (string, error)
- func (a *Asset) DeleteAsset(ctx context.Context, assetCID string) error
- func (a *Asset) GetAssetProgresses(ctx context.Context, assetCIDs []string) (*types.PullResult, error)
- func (a *Asset) GetAssetStats(ctx context.Context) (*types.AssetStats, error)
- func (a *Asset) GetAssetView(ctx context.Context) (*types.AssetView, error)
- func (a *Asset) GetAssetsInBucket(ctx context.Context, bucketID int) ([]string, error)
- func (a *Asset) GetBlocksOfAsset(assetCID string, randomSeed int64, randomCount int) ([]string, error)
- func (a *Asset) GetPullingAssetInfo(ctx context.Context) (*types.InProgressAsset, error)
- func (a *Asset) PullAsset(ctx context.Context, rootCID string, infos []*types.CandidateDownloadInfo) error
- func (a *Asset) PullAssetV2(ctx context.Context, req *types.AssetPullRequest) error
- func (a *Asset) RequestFreeUpDisk(ctx context.Context, size float64) error
- func (a *Asset) StateFreeUpDisk(ctx context.Context) (*types.FreeUpDiskStateResp, error)
- func (a *Asset) SyncAssetViewAndData(ctx context.Context) error
- type AssetPullerEncoder
- type Key
- type Manager
- func (m *Manager) AddLostAsset(root cid.Cid) error
- func (m *Manager) DeleteAsset(root cid.Cid) error
- func (m *Manager) GetAssetForValidation(ctx context.Context, randomSeed int64) (validate.Asset, error)
- func (m *Manager) GetAssetsOfBucket(ctx context.Context, bucketID uint32, isRemote bool) ([]cid.Cid, error)
- func (m *Manager) GetBlock(ctx context.Context, root, block cid.Cid) (blocks.Block, error)
- func (m *Manager) GetBlockCount(ctx context.Context, root cid.Cid) (int, error)
- func (m *Manager) GetBlocksOfAsset(root cid.Cid, randomSeed int64, randomCount int) ([]string, error)
- func (m *Manager) GetUploadingAsset(ctx context.Context, root cid.Cid) (*types.UploadingAsset, error)
- func (m *Manager) HasBlock(ctx context.Context, root, block cid.Cid) (bool, error)
- func (m *Manager) SaveUserAsset(ctx context.Context, userID string, root cid.Cid, assetSize int64, r io.Reader) error
- func (m *Manager) ScanBlocks(ctx context.Context, root cid.Cid) error
- func (m *Manager) SetAssetUploadProgress(ctx context.Context, root cid.Cid, progress *types.UploadProgress) error
- type ManagerOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewReleaser ¶ added in v0.1.19
func NewReleaser() *releaser
Types ¶
type AWS ¶ added in v0.1.13
type Asset ¶
func NewAsset ¶
func NewAsset(storageMgr *storage.Manager, scheduler api.Scheduler, assetMgr *Manager, apiSecret *jwt.HMACSHA, rateLimiter *types.RateLimiter) *Asset
NewAsset creates a new Asset instance
func (*Asset) AddAssetView ¶ added in v0.1.15
func (*Asset) BlockCountOfAsset ¶
BlockCountOfAsset returns the block count for the given asset.
func (*Asset) ClearFreeUpDisk ¶ added in v0.1.19
func (*Asset) CreateAsset ¶ added in v0.1.10
func (a *Asset) CreateAsset(ctx context.Context, tokenPayload *types.AuthUserUploadDownloadAsset) (string, error)
CreateAsset notify candidate that user upload asset, return auth token of candidate
func (*Asset) DeleteAsset ¶
DeleteAsset deletes the asset with the given CID
func (*Asset) GetAssetProgresses ¶
func (a *Asset) GetAssetProgresses(ctx context.Context, assetCIDs []string) (*types.PullResult, error)
GetAssetProgresses returns the progress of the given list of assets.
func (*Asset) GetAssetStats ¶
GetAssetStats returns statistics about the assets stored on this node
func (*Asset) GetAssetView ¶ added in v0.1.14
func (*Asset) GetAssetsInBucket ¶ added in v0.1.14
func (*Asset) GetBlocksOfAsset ¶
func (a *Asset) GetBlocksOfAsset(assetCID string, randomSeed int64, randomCount int) ([]string, error)
GetBlocksOfAsset returns a random subset of blocks for the given asset.
func (*Asset) GetPullingAssetInfo ¶
GetPullingAssetInfo returns information about the asset currently being pulled
func (*Asset) PullAsset ¶
func (a *Asset) PullAsset(ctx context.Context, rootCID string, infos []*types.CandidateDownloadInfo) error
PullAsset adds the asset to the waitList for pulling
func (*Asset) PullAssetV2 ¶ added in v0.1.19
PullAsset adds the asset to the waitList for pulling
func (*Asset) RequestFreeUpDisk ¶ added in v0.1.19
func (*Asset) StateFreeUpDisk ¶ added in v0.1.19
type AssetPullerEncoder ¶
type AssetPullerEncoder struct { Root string BlocksWaitList []string BlocksPulledSuccessList []string NextLayerCIDs []string DownloadSources *types.DownloadSources TotalSize uint64 DoneSize uint64 }
AssetPullerEncoder encodes or decodes assetPuller
type Manager ¶
Manager is the struct that manages asset pulling and store
func NewManager ¶
func NewManager(ctx context.Context, opts *ManagerOptions) (*Manager, error)
NewManager creates a new instance of Manager
func (*Manager) AddLostAsset ¶
AddLostAsset adds a lost asset to the Manager's waitList if it is not already present in the storage
func (*Manager) DeleteAsset ¶
DeleteAsset removes an asset from the datastore and the waitList.
func (*Manager) GetAssetForValidation ¶
func (m *Manager) GetAssetForValidation(ctx context.Context, randomSeed int64) (validate.Asset, error)
GetAssetForValidation returns a new instance of asset based on a given random seed
func (*Manager) GetAssetsOfBucket ¶
func (m *Manager) GetAssetsOfBucket(ctx context.Context, bucketID uint32, isRemote bool) ([]cid.Cid, error)
GetAssetsOfBucket retrieves the list of assets in a given bucket ID from the storage
func (*Manager) GetBlockCount ¶ added in v0.1.10
func (*Manager) GetBlocksOfAsset ¶
func (m *Manager) GetBlocksOfAsset(root cid.Cid, randomSeed int64, randomCount int) ([]string, error)
GetBlocksOfAsset returns a random selection of blocks for the given root CID return map, key is random number, value is cid string