feat: impl files endpoints

This commit is contained in:
2025-12-02 22:08:50 +00:00
parent e8a558d652
commit ca9dfd90b2
13 changed files with 372 additions and 61 deletions

View File

@@ -0,0 +1,34 @@
package virtualfs
import (
"io"
"github.com/get-drexa/drexa/internal/blob"
)
type FileContent struct {
Size int64
Reader io.ReadCloser
BlobKey blob.Key
URL string
}
func EmptyFileContent() FileContent {
return FileContent{}
}
func FileContentFromReader(reader io.Reader) FileContent {
return FileContent{Reader: io.NopCloser(reader)}
}
func FileContentFromReaderWithSize(reader io.Reader, size int64) FileContent {
return FileContent{Reader: io.NopCloser(reader), Size: size}
}
func FileContentFromBlobKey(blobKey blob.Key) FileContent {
return FileContent{BlobKey: blobKey}
}
func FileContentFromURL(url string) FileContent {
return FileContent{URL: url}
}