summaryrefslogtreecommitdiff
path: root/internal/converter/converter_interface.go
diff options
from:
to:
context:
space:
mode:
Diffstat (limited to 'internal/converter/converter_interface.go')
-rw-r--r--internal/converter/converter_interface.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/internal/converter/converter_interface.go b/internal/converter/converter_interface.go
new file mode 100644
index 0000000..342ca1e
--- /dev/null
+++ b/internal/converter/converter_interface.go
@@ -0,0 +1,16 @@
+package converter
+
+import (
+ "io"
+
+ "github.com/SayaAndy/saya-today-thumbnail-generator/config"
+)
+
+type Converter interface {
+ DeductOutputPath(inputPath string) string
+ Process(ext string, reader io.ReadCloser, writer io.WriteCloser) error
+}
+
+var NewConverterMap = map[string]func(cfg *config.ConverterConfig) (Converter, error){
+ "webp": NewWebpConverter,
+}