Documentation
¶
Index ¶
- func Worker(ctx context.Context, in <-chan struct{}, doWork func() error, ...) error
- type API
- type AddIndexesForUploadFunc
- type AddNodeToUploadShardsFunc
- type AddShardsForUploadFunc
- type AddStorachaUploadForUploadFunc
- type CloseUploadShardsFunc
- type ExecuteDagScansForUploadFunc
- type ExecuteScanFunc
- type RemoveBadFSEntryFunc
- type RemoveBadNodesFunc
- type RemoveShardFunc
- type Repo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type API ¶
type API struct {
Repo Repo
ExecuteScan ExecuteScanFunc
ExecuteDagScansForUpload ExecuteDagScansForUploadFunc
AddShardsForUpload AddShardsForUploadFunc
AddIndexesForUpload AddIndexesForUploadFunc
AddStorachaUploadForUpload AddStorachaUploadForUploadFunc
RemoveBadFSEntry RemoveBadFSEntryFunc
RemoveBadNodes RemoveBadNodesFunc
RemoveShard RemoveShardFunc
// AddNodeToUploadShards adds a node to the upload's shards, creating a new
// shard if necessary. It returns true if an existing open shard was closed,
// false otherwise.
AddNodeToUploadShards AddNodeToUploadShardsFunc
// CloseUploadShards closes any remaining open shard for the upload. It
// returns true if an existing open shard was in fact closed, false if there
// was no open shard to close.
CloseUploadShards CloseUploadShardsFunc
}
func (API) ExecuteUpload ¶
func (a API) ExecuteUpload(ctx context.Context, uploadID id.UploadID, spaceDID did.DID) (cid.Cid, error)
ExecuteUpload executes the upload process for a given upload, handling its state transitions and processing steps.
func (API) FindOrCreateUploads ¶
FindOrCreateUploads creates uploads for a given space and its associated sources.
type AddIndexesForUploadFunc ¶
type AddShardsForUploadFunc ¶
type CloseUploadShardsFunc ¶
type ExecuteScanFunc ¶
type RemoveBadFSEntryFunc ¶
type RemoveBadNodesFunc ¶
type Repo ¶
type Repo interface {
// GetUploadByID retrieves an upload by its unique ID.
GetUploadByID(ctx context.Context, uploadID id.UploadID) (*uploadmodel.Upload, error)
// FindOrCreateUploads ensures uploads exist for a given space
FindOrCreateUploads(ctx context.Context, spaceDID did.DID, sourceIDs []id.SourceID) ([]*uploadmodel.Upload, error)
// UpdateUpload updates the state of an upload in the repository.
UpdateUpload(ctx context.Context, upload *uploadmodel.Upload) error
// CIDForFSEntry retrieves the CID for a file system entry by its ID.
CIDForFSEntry(ctx context.Context, fsEntryID id.FSEntryID) (cid.Cid, error)
// CreateDAGScan creates a new DAG scan for a file system entry.
CreateDAGScan(ctx context.Context, fsEntryID id.FSEntryID, isDirectory bool, uploadID id.UploadID, spaceDID did.DID) (dagmodel.DAGScan, error)
// ListSpaceSources lists all space sources for the given space DID.
ListSpaceSources(ctx context.Context, spaceDID did.DID) ([]id.SourceID, error)
}
Click to show internal directories.
Click to hide internal directories.