From 48cbbf652a447eac5f55cb10ba27b713b6fd7387 Mon Sep 17 00:00:00 2001 From: Matt Baer Date: Wed, 24 Mar 2021 15:33:34 -0400 Subject: [PATCH] Support attachments on activitystreams.Object --- activitystreams/activity.go | 1 + activitystreams/attachment.go | 12 ++++++++++++ 2 files changed, 13 insertions(+) create mode 100644 activitystreams/attachment.go diff --git a/activitystreams/activity.go b/activitystreams/activity.go index 83f87b7..93a40af 100644 --- a/activitystreams/activity.go +++ b/activitystreams/activity.go @@ -117,6 +117,7 @@ type Object struct { Content string `json:"content"` ContentMap map[string]string `json:"contentMap,omitempty"` Tag []Tag `json:"tag"` + Attachment []Attachment `json:"attachment,omitempty"` // Extensions // NOTE: add extensions here diff --git a/activitystreams/attachment.go b/activitystreams/attachment.go new file mode 100644 index 0000000..b2b47e9 --- /dev/null +++ b/activitystreams/attachment.go @@ -0,0 +1,12 @@ +package activitystreams + +type Attachment struct { + Type AttachmentType `json:"type"` + URL string `json:"url"` + MediaType string `json:"mediaType"` + Name string `json:"name"` +} + +type AttachmentType string + +const AttachImage AttachmentType = "Image"