Documentation
¶
Index ¶
- func Worker(ctx context.Context, in <-chan struct{}, doWork func() error, ...) error
- type API
- type AddIndexesForUploadFunc
- type AddNodeToUploadShardsFunc
- type AddNodesToUploadShardsFunc
- type AddShardsForUploadFunc
- type AddShardsToUploadIndexesFunc
- type AddStorachaUploadForUploadFunc
- type CloseUploadIndexesFunc
- type CloseUploadShardsFunc
- type ExecuteDagScansForUploadFunc
- type ExecuteScanFunc
- type PostProcessUploadedIndexesFunc
- type PostProcessUploadedShardsFunc
- 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
PostProcessUploadedShards PostProcessUploadedShardsFunc
PostProcessUploadedIndexes PostProcessUploadedIndexesFunc
AddIndexesForUpload AddIndexesForUploadFunc
AddStorachaUploadForUpload AddStorachaUploadForUploadFunc
RemoveBadFSEntry RemoveBadFSEntryFunc
RemoveBadNodes RemoveBadNodesFunc
RemoveShard RemoveShardFunc
// AddNodesToUploadShards assigns all unsharded nodes for an upload to shards.
AddNodesToUploadShards AddNodesToUploadShardsFunc
// AddShardsToUploadIndexes adds the contents of shards to the upload's indexes, creating new
// indexes if necessary. If an index is closed as a result, the provided
// `indexCB` callback is called with the closed index. `indexCB` may be nil.
AddShardsToUploadIndexes AddShardsToUploadIndexesFunc
// CloseUploadShards closes any remaining open shard for the upload.
CloseUploadShards CloseUploadShardsFunc
// CloseUploadIndexes closes any remaining open index for the upload.
CloseUploadIndexes CloseUploadIndexesFunc
// Publishes events observation
Publisher bus.Publisher
// AssumeUnchangedSources skips the filesystem scan when a completed scan
// already exists, assuming the filesystem hasn't changed since the last run.
AssumeUnchangedSources bool
}
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 AddNodesToUploadShardsFunc ¶ added in v0.4.0
type AddShardsForUploadFunc ¶
type AddShardsToUploadIndexesFunc ¶ added in v0.4.0
type CloseUploadIndexesFunc ¶ added in v0.4.0
type CloseUploadShardsFunc ¶
type ExecuteScanFunc ¶
type PostProcessUploadedIndexesFunc ¶ added in v0.4.0
type PostProcessUploadedShardsFunc ¶ added in v0.4.0
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.