summaryrefslogtreecommitdiff
path: root/internal/media/types.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2022-02-22 13:50:33 +0100
committerLibravatar GitHub <noreply@github.com>2022-02-22 13:50:33 +0100
commit55b83bea7cad893aabda4ab5e05c248fb66e1e51 (patch)
tree4f0fe25b706e5635bcdd91e6ad19324fc250760a /internal/media/types.go
parent[bugfix] Fix thumbnail image type (#406) (diff)
downloadgotosocial-55b83bea7cad893aabda4ab5e05c248fb66e1e51.tar.xz
[feature] Add postDataCallbackFunc to allow cleanup (#408)
Diffstat (limited to 'internal/media/types.go')
-rw-r--r--internal/media/types.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/internal/media/types.go b/internal/media/types.go
index a6b38b467..cceff216c 100644
--- a/internal/media/types.go
+++ b/internal/media/types.go
@@ -119,3 +119,9 @@ type AdditionalEmojiInfo struct {
// DataFunc represents a function used to retrieve the raw bytes of a piece of media.
type DataFunc func(ctx context.Context) (reader io.Reader, fileSize int, err error)
+
+// PostDataCallbackFunc represents a function executed after the DataFunc has been executed,
+// and the returned reader has been read. It can be used to clean up any remaining resources.
+//
+// This can be set to nil, and will then not be executed.
+type PostDataCallbackFunc func(ctx context.Context) error