summaryrefslogtreecommitdiff
path: root/internal/api/model/content.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2022-02-19 11:44:56 +0100
committerLibravatar GitHub <noreply@github.com>2022-02-19 11:44:56 +0100
commit23034ec145662b9edcd98df3a570e968389e3fa8 (patch)
treebb5678a1fae1c70a8a49b58ce17c5d51eae8710c /internal/api/model/content.go
parentUse type=email for email input (#400) (diff)
downloadgotosocial-23034ec145662b9edcd98df3a570e968389e3fa8.tar.xz
[feature] Stream files via reader (#404)
* serve files via reader rather than byte slice * close readcloser when we're done with it * cast reader to readcloser
Diffstat (limited to 'internal/api/model/content.go')
-rw-r--r--internal/api/model/content.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/internal/api/model/content.go b/internal/api/model/content.go
index 754495738..2f38b2351 100644
--- a/internal/api/model/content.go
+++ b/internal/api/model/content.go
@@ -18,14 +18,16 @@
package model
+import "io"
+
// Content wraps everything needed to serve a blob of content (some kind of media) through the API.
type Content struct {
// MIME content type
ContentType string
// ContentLength in bytes
ContentLength int64
- // Actual content blob
- Content []byte
+ // Actual content
+ Content io.Reader
}
// GetContentRequestForm describes a piece of content desired by the caller of the fileserver API.