all repos — website @ 3162ceaa0f7997742f8c2fce1c9660e8e86ad5bb

My website

use buffers as interface to storage

Alan Pearce
commit

3162ceaa0f7997742f8c2fce1c9660e8e86ad5bb

parent

a93b5ad88ea3cf742cf03fdeeb95f63865f08374

1 file changed, 5 insertions(+), 4 deletions(-)

changed files
M internal/storage/files/reader.gointernal/storage/files/reader.go
@@ -5,6 +5,7 @@ "io/fs"
"path/filepath" "strings" + "go.alanpearce.eu/website/internal/storage" "go.alanpearce.eu/x/log" "gitlab.com/tozd/go/errors"
@@ -13,14 +14,14 @@
type Reader struct { root string log *log.Logger - files map[string]*File + files map[string]*storage.File } func NewReader(path string, log *log.Logger) (*Reader, error) { r := &Reader{ root: path, log: log, - files: make(map[string]*File), + files: make(map[string]*storage.File), } if err := r.registerContentFiles(); err != nil { return nil, errors.WithMessagef(err, "registering content files")
@@ -69,8 +70,8 @@
return nil } -func (r *Reader) GetFile(urlPath string) *File { - return r.files[urlPath] +func (r *Reader) GetFile(urlPath string) (*storage.File, error) { + return r.files[urlPath], nil } func (r *Reader) CanonicalisePath(path string) (cPath string, differs bool) {