about summary refs log tree commit diff stats
path: root/internal/storage
diff options
context:
space:
mode:
authorAlan Pearce2025-01-26 21:34:06 +0100
committerAlan Pearce2025-01-26 21:34:06 +0100
commit04809ffd7971032818238db14feb6d3c95470e3b (patch)
treeb87da3fb771c854b011c75e1026d206d10e9403f /internal/storage
parente616014e22fca30cb6375352f70f73d234cb1f7c (diff)
downloadwebsite-04809ffd7971032818238db14feb6d3c95470e3b.tar.lz
website-04809ffd7971032818238db14feb6d3c95470e3b.tar.zst
website-04809ffd7971032818238db14feb6d3c95470e3b.zip
use storage.Writer interface in builder
Diffstat (limited to 'internal/storage')
-rw-r--r--internal/storage/interface.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/internal/storage/interface.go b/internal/storage/interface.go
new file mode 100644
index 0000000..6c8f3cd
--- /dev/null
+++ b/internal/storage/interface.go
@@ -0,0 +1,21 @@
+package storage
+
+import (
+	"io"
+
+	"github.com/a-h/templ"
+)
+
+type Writer interface {
+	Mkdirp(path string) error
+
+	Open(filename string) (io.ReadCloser, error)
+
+	OpenFileAndVariants(filename string) (io.WriteCloser, error)
+
+	OutputToFile(output io.Reader, filename string) error
+
+	RenderToFile(component templ.Component, filename string) error
+
+	WriterToFile(writer io.WriterTo, filename string) error
+}