Documentation
¶
Index ¶
- Variables
- type CompletedJob
- type ImageJob
- type Manager
- func (m *Manager) CancelTask() error
- func (m *Manager) GetCompletedJobs() []*CompletedJob
- func (m *Manager) GetPreviewInfo(index int) *CompletedJob
- func (m *Manager) GetStatus() (total, done, failed int, status string)
- func (m *Manager) PauseTask() error
- func (m *Manager) ResumeTask() error
- func (m *Manager) SetEmitter(emitter *events.Emitter)
- func (m *Manager) StartCompress(ctx context.Context, inputDir, outputDir, preset string, concurrency int) error
Constants ¶
This section is empty.
Variables ¶
View Source
var PresetQuality = map[string]int{
"HIGH_QUALITY": 85,
"BALANCED": 70,
"HIGH_COMPRESSION": 50,
}
PresetQuality 预设对应的质量参数
Functions ¶
This section is empty.
Types ¶
type CompletedJob ¶
type CompletedJob struct {
Index int `json:"index"`
FileName string `json:"fileName"`
SourcePath string `json:"sourcePath"`
TargetPath string `json:"targetPath"`
OldSize int64 `json:"oldSize"`
NewSize int64 `json:"newSize"`
Status string `json:"status"` // "done" / "error" / "skipped"
Message string `json:"message"`
Ratio string `json:"ratio"`
}
CompletedJob 已完成的任务信息
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager 任务管理器
func (*Manager) GetCompletedJobs ¶
func (m *Manager) GetCompletedJobs() []*CompletedJob
GetCompletedJobs 获取已完成的任务列表
func (*Manager) GetPreviewInfo ¶
func (m *Manager) GetPreviewInfo(index int) *CompletedJob
GetPreviewInfo 获取预览信息
func (*Manager) SetEmitter ¶
SetEmitter 设置事件发射器
Click to show internal directories.
Click to hide internal directories.