Documentation ¶ Overview ¶ Package pool provides compressing pipeline implementation. Index ¶ type FileInfo type Pool func NewPool(ctx context.Context, worker Worker) Pool func (p *Pool) Run(filePaths []string, workersCount uint8) <-chan Result type PreRunner type Result type Task type Worker Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ This section is empty. Types ¶ type FileInfo ¶ type FileInfo interface { Size() uint64 Type() string } type Pool ¶ type Pool struct { // contains filtered or unexported fields } func NewPool ¶ func NewPool(ctx context.Context, worker Worker) Pool func (*Pool) Run ¶ func (p *Pool) Run(filePaths []string, workersCount uint8) <-chan Result type PreRunner ¶ type PreRunner interface { PreTaskRun(task Task) } type Result ¶ type Result struct { Task Task FileType string FilePath string OriginalSize uint64 // in bytes CompressedSize uint64 // in bytes Err error // if Err is not nil - some error occurred during task processing } type Task ¶ type Task struct { FilePath string TaskNumber uint // from 1 to TasksCount TasksCount uint // summary task count } type Worker ¶ type Worker interface { Upload(ctx context.Context, filePath string) (url string, info FileInfo, err error) Download(ctx context.Context, url, toFilePath string) (info FileInfo, err error) CopyContent(fromFilePath, toFilePath string) error RemoveFile(filePath string) error } Source Files ¶ View all Source files pool.go Click to show internal directories. Click to hide internal directories.