use buffers as interface to storage
1 file changed, 5 insertions(+), 4 deletions(-)
changed files
M internal/storage/files/reader.go → internal/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) {