diff options
Diffstat (limited to 'internal/storage/files/reader.go')
-rw-r--r-- | internal/storage/files/reader.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/internal/storage/files/reader.go b/internal/storage/files/reader.go index 425436b..fff37da 100644 --- a/internal/storage/files/reader.go +++ b/internal/storage/files/reader.go @@ -5,6 +5,7 @@ import ( "path/filepath" "strings" + "go.alanpearce.eu/website/internal/storage" "go.alanpearce.eu/x/log" "gitlab.com/tozd/go/errors" @@ -13,14 +14,14 @@ import ( 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 @@ func (r *Reader) registerContentFiles() error { 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) { |