all repos — homestead @ db6f2461ccd1e17e620451aab958068f6ca1664e

Code for my website

use buffers as interface to storage

Alan Pearce
commit

db6f2461ccd1e17e620451aab958068f6ca1664e

parent

89e01856dc026ca3c32f81a4ee8f233efd0e232c

1 file changed, 7 insertions(+), 12 deletions(-)

changed files
M internal/storage/interface.gointernal/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 }