diff options
author | 2022-01-11 17:49:14 +0100 | |
---|---|---|
committer | 2022-01-11 17:49:14 +0100 | |
commit | 113f9d9ab4797de6ae17819c96ae866992214021 (patch) | |
tree | c4e165e66e66db7b9e20d34ccb45f7bda096b532 /internal/media/types.go | |
parent | test the media manager a bit, add shutdown logic (diff) | |
download | gotosocial-113f9d9ab4797de6ae17819c96ae866992214021.tar.xz |
pass a function into the manager, start work on emoji
Diffstat (limited to 'internal/media/types.go')
-rw-r--r-- | internal/media/types.go | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/internal/media/types.go b/internal/media/types.go index aaf423682..6426223d1 100644 --- a/internal/media/types.go +++ b/internal/media/types.go @@ -20,6 +20,7 @@ package media import ( "bytes" + "context" "errors" "fmt" "time" @@ -68,9 +69,9 @@ const ( TypeEmoji Type = "emoji" // TypeEmoji is the key for emoji type requests ) -// AdditionalInfo represents additional information that should be added to an attachment +// AdditionalMediaInfo represents additional information that should be added to an attachment // when processing a piece of media. -type AdditionalInfo struct { +type AdditionalMediaInfo struct { // Time that this media was created; defaults to time.Now(). CreatedAt *time.Time // ID of the status to which this media is attached; defaults to "". @@ -93,6 +94,13 @@ type AdditionalInfo struct { FocusY *float32 } +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) + // parseContentType parses the MIME content type from a file, returning it as a string in the form (eg., "image/jpeg"). // Returns an error if the content type is not something we can process. func parseContentType(content []byte) (string, error) { |