summaryrefslogtreecommitdiff
path: root/internal/media/types.go
diff options
context:
space:
mode:
authorLibravatar tsmethurst <tobi.smethurst@protonmail.com>2022-01-16 18:52:55 +0100
committerLibravatar tsmethurst <tobi.smethurst@protonmail.com>2022-01-16 18:52:55 +0100
commit589bb9df0275457b5f9c3790e67517ec1be1745d (patch)
tree8b15a4a457bb7ac1d4b209e5cb930cb4ec315ca8 /internal/media/types.go
parentupdate dependencies (diff)
downloadgotosocial-589bb9df0275457b5f9c3790e67517ec1be1745d.tar.xz
pass reader around instead of []byte
Diffstat (limited to 'internal/media/types.go')
-rw-r--r--internal/media/types.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/internal/media/types.go b/internal/media/types.go
index 5b3fe4a41..0a7f60d66 100644
--- a/internal/media/types.go
+++ b/internal/media/types.go
@@ -20,6 +20,7 @@ package media
import (
"context"
+ "io"
"time"
)
@@ -28,7 +29,7 @@ import (
//
// See: https://en.wikipedia.org/wiki/File_format#File_header
// and https://github.com/h2non/filetype
-const maxFileHeaderBytes = 262
+const maxFileHeaderBytes = 261
// mime consts
const (
@@ -117,4 +118,4 @@ type AdditionalEmojiInfo struct {
}
// DataFunc represents a function used to retrieve the raw bytes of a piece of media.
-type DataFunc func(ctx context.Context) ([]byte, error)
+type DataFunc func(ctx context.Context) (io.Reader, error)