mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
[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
This commit is contained in:
@@ -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.
|
||||
|
Reference in New Issue
Block a user