summaryrefslogtreecommitdiff
path: root/internal/message/processor.go
diff options
context:
space:
mode:
authorLibravatar Tobi Smethurst <31960611+tsmethurst@users.noreply.github.com>2021-05-10 16:29:05 +0200
committerLibravatar GitHub <noreply@github.com>2021-05-10 16:29:05 +0200
commit742f985d5b0620ad14015f9a2df9940edc254bf4 (patch)
tree5c8d469fd015efc6f8459f2d9df04132877285a3 /internal/message/processor.go
parentWebfinger + Small fixes (#20) (diff)
downloadgotosocial-742f985d5b0620ad14015f9a2df9940edc254bf4.tar.xz
Mediahandler (#21)
Media GET and media PUT handlers
Diffstat (limited to 'internal/message/processor.go')
-rw-r--r--internal/message/processor.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/internal/message/processor.go b/internal/message/processor.go
index d150d56e6..c8d58a346 100644
--- a/internal/message/processor.go
+++ b/internal/message/processor.go
@@ -74,13 +74,18 @@ type Processor interface {
// AppCreate processes the creation of a new API application
AppCreate(authed *oauth.Auth, form *apimodel.ApplicationCreateRequest) (*apimodel.Application, error)
+ // FileGet handles the fetching of a media attachment file via the fileserver.
+ FileGet(authed *oauth.Auth, form *apimodel.GetContentRequestForm) (*apimodel.Content, error)
+
// InstanceGet retrieves instance information for serving at api/v1/instance
InstanceGet(domain string) (*apimodel.Instance, ErrorWithCode)
// MediaCreate handles the creation of a media attachment, using the given form.
MediaCreate(authed *oauth.Auth, form *apimodel.AttachmentRequest) (*apimodel.Attachment, error)
- // MediaGet handles the fetching of a media attachment, using the given request form.
- MediaGet(authed *oauth.Auth, form *apimodel.GetContentRequestForm) (*apimodel.Content, error)
+ // MediaGet handles the GET of a media attachment with the given ID
+ MediaGet(authed *oauth.Auth, attachmentID string) (*apimodel.Attachment, ErrorWithCode)
+ // MediaUpdate handles the PUT of a media attachment with the given ID and form
+ MediaUpdate(authed *oauth.Auth, attachmentID string, form *apimodel.AttachmentUpdateRequest) (*apimodel.Attachment, ErrorWithCode)
// StatusCreate processes the given form to create a new status, returning the api model representation of that status if it's OK.
StatusCreate(authed *oauth.Auth, form *apimodel.AdvancedStatusCreateForm) (*apimodel.Status, error)