diff options
| author | Jan Wolff <janw@mailbox.org> | 2025-09-12 09:34:01 +0200 |
|---|---|---|
| committer | Jan Wolff <janw@mailbox.org> | 2025-09-12 09:34:01 +0200 |
| commit | 283c31564a9d5dab4b8b71d7498886b0cd20a999 (patch) | |
| tree | bc15867a389f25b1855042b5af20efba96c68dbb /storage/file.go | |
initial commit
Diffstat (limited to 'storage/file.go')
| -rw-r--r-- | storage/file.go | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/storage/file.go b/storage/file.go new file mode 100644 index 0000000..6fa5070 --- /dev/null +++ b/storage/file.go @@ -0,0 +1,21 @@ +package storage + +import ( + "bytes" + "time" +) + +type File struct { + Protected bool + Filename string + Data []byte + AvailableUntil time.Time +} + +func (f File) IsAvailable() bool { + return time.Now().Before(f.AvailableUntil) +} + +func (f File) Reader() *bytes.Reader { + return bytes.NewReader(f.Data) +} |
