Documentation
¶
Index ¶
- func NewImageEngine(workerPool *WorkerPool) domain.IConverter
- func NewImageEngineLegacy(workerCount int, workerPool *WorkerPool) ports.IConverter
- type BatchConversionResult
- type BatchConversionTask
- type ImageEngine
- type ImageEngineLegacy
- func (e *ImageEngineLegacy) BatchProcess(images [][]byte) [][]byte
- func (e *ImageEngineLegacy) Convert(input []byte, outputFormat domain.Format) []byte
- func (e *ImageEngineLegacy) GetSupportedInputTypes() []domain.FileType
- func (e *ImageEngineLegacy) GetSupportedOutputTypes() []domain.Format
- func (e *ImageEngineLegacy) Validate(file string) domain.ValidationResult
- type Job
- type Result
- type WorkerPool
- type WorkerPoolLegacy
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewImageEngine ¶
func NewImageEngine(workerPool *WorkerPool) domain.IConverter
NewImageEngine creates a new image conversion engine
func NewImageEngineLegacy ¶
func NewImageEngineLegacy( workerCount int, workerPool *WorkerPool, ) ports.IConverter
NewImageEngineLegacy creates a new image conversion engine (legacy/unused)
Types ¶
type BatchConversionResult ¶
BatchConversionResult represents the result of a batch conversion task
type BatchConversionTask ¶
BatchConversionTask represents a single conversion task in a batch
type ImageEngine ¶
type ImageEngine struct {
// contains filtered or unexported fields
}
ImageEngine implements IConverter for image format conversions
func (*ImageEngine) BatchConvert ¶
func (e *ImageEngine) BatchConvert(tasks []BatchConversionTask) []BatchConversionResult
BatchConvert processes multiple image conversions in parallel using the worker pool It takes a slice of input/output path pairs and processes them concurrently utilizing all available CPU cores through the worker pool
func (*ImageEngine) Close ¶
func (e *ImageEngine) Close()
Close closes the worker pool to prevent goroutine leaks
type ImageEngineLegacy ¶
type ImageEngineLegacy struct {
// contains filtered or unexported fields
}
ImageEngineLegacy implements ports.IConverter for image format conversions (legacy/unused) NOTE: This is a legacy implementation that is not currently used. The active implementation is in engine.go which implements domain.IConverter
func (*ImageEngineLegacy) BatchProcess ¶
func (e *ImageEngineLegacy) BatchProcess(images [][]byte) [][]byte
BatchProcess processes multiple images in batch
func (*ImageEngineLegacy) Convert ¶
func (e *ImageEngineLegacy) Convert(input []byte, outputFormat domain.Format) []byte
Convert performs the conversion from input to output format
func (*ImageEngineLegacy) GetSupportedInputTypes ¶
func (e *ImageEngineLegacy) GetSupportedInputTypes() []domain.FileType
GetSupportedInputTypes returns the input file types this converter supports
func (*ImageEngineLegacy) GetSupportedOutputTypes ¶
func (e *ImageEngineLegacy) GetSupportedOutputTypes() []domain.Format
GetSupportedOutputTypes returns the output formats this converter supports
func (*ImageEngineLegacy) Validate ¶
func (e *ImageEngineLegacy) Validate(file string) domain.ValidationResult
Validate checks if the input file is valid for this converter
type WorkerPool ¶
type WorkerPool struct {
// contains filtered or unexported fields
}
WorkerPool manages parallel image processing using CPU cores
func NewWorkerPool ¶
func NewWorkerPool() *WorkerPool
NewWorkerPool creates a new worker pool with NumCPU workers
func (*WorkerPool) Submit ¶
func (p *WorkerPool) Submit(task func())
Submit submits a task to the worker pool
type WorkerPoolLegacy ¶
type WorkerPoolLegacy struct {
// contains filtered or unexported fields
}
WorkerPoolLegacy manages parallel image processing (legacy/unused) NOTE: This is a legacy implementation that is not currently used. The active implementation is in worker_pool.go
func NewWorkerPoolLegacy ¶
func NewWorkerPoolLegacy(workers int) *WorkerPoolLegacy
NewWorkerPoolLegacy creates a new worker pool (legacy/unused)
func (*WorkerPoolLegacy) Collect ¶
func (p *WorkerPoolLegacy) Collect() []Result
Collect collects results from the worker pool
func (*WorkerPoolLegacy) Shutdown ¶
func (p *WorkerPoolLegacy) Shutdown()
Shutdown shuts down the worker pool
func (*WorkerPoolLegacy) Submit ¶
func (p *WorkerPoolLegacy) Submit(job Job)
Submit submits a job to the worker pool