storage: allow any read-seekable data as encoded content
3 files changed, 5 insertions(+), 6 deletions(-)
M internal/storage/file.go → internal/storage/file.go
@@ -1,9 +1,8 @@ package storage import ( + "io" "time" - - "go.alanpearce.eu/website/internal/buffer" ) type File struct {@@ -11,7 +10,7 @@ Path string ContentType string LastModified time.Time Etag string - Encodings map[string]*buffer.Buffer + Encodings map[string]io.ReadSeeker } func (f *File) AvailableEncodings() []string {
M internal/storage/files/file.go → internal/storage/files/file.go
@@ -46,8 +46,8 @@ Path: path, ContentType: mime.TypeByExtension(filepath.Ext(filename)), LastModified: stat.ModTime(), Etag: etag, - Encodings: map[string]*buffer.Buffer{ - "identity": buf, + Encodings: map[string]io.ReadSeeker{ + "identity": f, }, }
M internal/storage/files/writer.go → internal/storage/files/writer.go
@@ -44,7 +44,7 @@ Path: path, ContentType: "", LastModified: time.Time{}, Etag: "", - Encodings: map[string]*buffer.Buffer{ + Encodings: map[string]io.ReadSeeker{ "identity": nil, }, }