Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DownloadFailure ¶
DownloadFailure carries a unified failure notification from the downloader to a single status update point in the client loop.
type DownloadManager ¶
type DownloadManager struct {
ResourceDownloads map[string][]*pb.Task // SourcePath → Tasks waiting
ResourceMemory map[string]FileMetadata // SourcePath → Metadata
FileQueue chan *FileTransfer // Limited queue (maxDownloads=20)
TaskQueue chan *pb.Task // Unlimited queue (tasks waiting for download)
CompletionQueue chan *FileMetadata // Completed downloads
ExecQueue chan *pb.Task // Tasks ready for execution
FailedQueue chan *DownloadFailure // Tasks that failed during downloads (centralized reporting)
Store string
// Tracks tasks currently being scheduled for downloads to ensure idempotency at the boundary.
EnqueuedTasks map[int32]bool
// Per-task chrono map for download durations
DownloadStart map[int32]time.Time
// Per-task pending set for download items
TaskPending map[int32]map[string]bool // Task ID → set of pending item keys (I:input, R:resource, D:docker)
RcloneRemotes *pb.RcloneRemotes
// contains filtered or unexported fields
}
DownloadManager manages task downloads.
func NewDownloadManager ¶
func NewDownloadManager(store string, reporter *event.Reporter, rcloneRemotes *pb.RcloneRemotes) *DownloadManager
NewDownloadManager initializes the download manager.
func RunDownloader ¶
func RunDownloader(store string, reporter *event.Reporter, rcloneRemotes *pb.RcloneRemotes) *DownloadManager
run downloader
func (*DownloadManager) ProcessDownloads ¶
func (dm *DownloadManager) ProcessDownloads()
ProcessDownloads manages incoming tasks and processes downloads.
func (*DownloadManager) StartDownloadWorkers ¶
func (dm *DownloadManager) StartDownloadWorkers()
StartDownloadWorkers launches download workers.
type FileMetadata ¶
type FileMetadata struct {
TaskId int32
Task *pb.Task
SourcePath string
FilePath string
FileType FileType
Size int64
Date time.Time
MD5 string
Success bool // true if download succeeded
}
ResourceMetadata stores metadata for downloaded resources.
type FileTransfer ¶
type SyncCounter ¶
type SyncCounter struct {
// contains filtered or unexported fields
}
func (*SyncCounter) Set ¶
func (sc *SyncCounter) Set(taskID int32, count int)
type UploadFailure ¶
UploadFailure carries a unified failure notification from the uploader to a single status update point in the client loop.
type UploadManager ¶
type UploadManager struct {
UploadQueue chan *UploadFile
Completion chan *pb.Task
FailedQueue chan *UploadFailure
Store string
Client pb.TaskQueueClient
RcloneRemotes *pb.RcloneRemotes
// contains filtered or unexported fields
}
func NewUploadManager ¶
func NewUploadManager(store string, client pb.TaskQueueClient, reporter *event.Reporter, rcloneRemotes *pb.RcloneRemotes) *UploadManager
func RunUploader ¶
func RunUploader(store string, client pb.TaskQueueClient, activeTasks *sync.Map, reporter *event.Reporter, rcloneRemotes *pb.RcloneRemotes) *UploadManager
RunUploader starts upload workers and returns the manager.
func (*UploadManager) EnqueueTaskOutput ¶
func (um *UploadManager) EnqueueTaskOutput(task *pb.Task)
func (*UploadManager) StartUploadWorkers ¶
func (um *UploadManager) StartUploadWorkers(activeTasks *sync.Map)
Click to show internal directories.
Click to hide internal directories.