diff options
author | Alan Pearce | 2025-01-29 22:00:45 +0100 |
---|---|---|
committer | Alan Pearce | 2025-01-29 23:27:45 +0100 |
commit | 3162ceaa0f7997742f8c2fce1c9660e8e86ad5bb (patch) | |
tree | 14c424b8ef8b9238e69393cd7da1d0af6833526e /internal/storage/interface.go | |
parent | a93b5ad88ea3cf742cf03fdeeb95f63865f08374 (diff) | |
download | website-3162ceaa0f7997742f8c2fce1c9660e8e86ad5bb.tar.lz website-3162ceaa0f7997742f8c2fce1c9660e8e86ad5bb.tar.zst website-3162ceaa0f7997742f8c2fce1c9660e8e86ad5bb.zip |
use buffers as interface to storage
Diffstat (limited to 'internal/storage/interface.go')
-rw-r--r-- | internal/storage/interface.go | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/internal/storage/interface.go b/internal/storage/interface.go index 6c8f3cd..c167a49 100644 --- a/internal/storage/interface.go +++ b/internal/storage/interface.go @@ -1,21 +1,16 @@ package storage import ( - "io" - - "github.com/a-h/templ" + "go.alanpearce.eu/website/internal/buffer" ) +type Reader interface { + GetFile(path string) (*File, error) + CanonicalisePath(path string) (cPath string, differs bool) +} + 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 + Write(pathname string, content *buffer.Buffer) error } |