about summary refs log tree commit diff stats
path: root/internal/storage/file.go
diff options
context:
space:
mode:
authorAlan Pearce2025-01-27 21:42:41 +0100
committerAlan Pearce2025-01-28 01:28:32 +0100
commit127a675fc7cd9cdb65e4b4caac21e0f259102ee8 (patch)
tree9f2e269187702a4ea26bd776547d99e3832c60a6 /internal/storage/file.go
parent04809ffd7971032818238db14feb6d3c95470e3b (diff)
downloadwebsite-127a675fc7cd9cdb65e4b4caac21e0f259102ee8.tar.lz
website-127a675fc7cd9cdb65e4b4caac21e0f259102ee8.tar.zst
website-127a675fc7cd9cdb65e4b4caac21e0f259102ee8.zip
serve files from Storage implementation
Diffstat (limited to 'internal/storage/file.go')
-rw-r--r--internal/storage/file.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/internal/storage/file.go b/internal/storage/file.go
new file mode 100644
index 0000000..f588bf3
--- /dev/null
+++ b/internal/storage/file.go
@@ -0,0 +1,23 @@
+package storage
+
+import (
+	"io"
+	"time"
+)
+
+type File struct {
+	Path         string
+	ContentType  string
+	LastModified time.Time
+	Etag         string
+	Encodings    map[string]io.ReadSeekCloser
+}
+
+func (f *File) AvailableEncodings() []string {
+	encs := make([]string, 0, len(f.Encodings))
+	for enc := range f.Encodings {
+		encs = append(encs, enc)
+	}
+
+	return encs
+}