all repos — homestead @ 253cb999adcc8151af0888e6188aacb1420a73c9

Code for my website

serve files from Storage implementation

Alan Pearce
commit

253cb999adcc8151af0888e6188aacb1420a73c9

parent

97082ddc687eb1a9279addf0370a94bdf94f1862

1 file changed, 23 insertions(+), 0 deletions(-)

changed files
A 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 +}