Page MenuHomeMusing Studio

No OneTemporary

diff --git a/activitystreams/data.go b/activitystreams/data.go
index 2b88459..d3453a3 100644
--- a/activitystreams/data.go
+++ b/activitystreams/data.go
@@ -1,15 +1,43 @@
package activitystreams
type (
+ BaseObject struct {
+ Context []string `json:"@context"`
+ Type string `json:"type"`
+ ID string `json:"id"`
+ }
+
PublicKey struct {
ID string `json:"id"`
Owner string `json:"owner"`
PublicKeyPEM string `json:"publicKeyPem"`
}
Image struct {
Type string `json:"type"`
MediaType string `json:"mediaType"`
URL string `json:"url"`
}
)
+
+type OrderedCollection struct {
+ BaseObject
+ TotalItems int `json:"totalItems"`
+ First string `json:"first"`
+ Last string `json:"last,omitempty"`
+}
+
+func NewOrderedCollection(accountRoot string, items int) *OrderedCollection {
+ oc := OrderedCollection{
+ BaseObject: BaseObject{
+ Context: []string{
+ "https://www.w3.org/ns/activitystreams",
+ },
+ ID: accountRoot + "/outbox",
+ Type: "OrderedCollection",
+ },
+ First: accountRoot + "/outbox?page=1",
+ TotalItems: items,
+ }
+ return &oc
+}
diff --git a/activitystreams/person.go b/activitystreams/person.go
index 495671f..4cd1a21 100644
--- a/activitystreams/person.go
+++ b/activitystreams/person.go
@@ -1,34 +1,34 @@
package activitystreams
type Person struct {
- Context []string `json:"@context"`
- Type string `json:"type"`
- ID string `json:"id"`
+ BaseObject
Inbox string `json:"inbox"`
Outbox string `json:"outbox"`
PreferredUsername string `json:"preferredUsername"`
URL string `json:"url"`
Name string `json:"name"`
Icon Image `json:"icon"`
Following string `json:"following"`
Followers string `json:"followers"`
Summary string `json:"summary"`
PublicKey PublicKey `json:"publicKey"`
}
func NewPerson(accountRoot string) *Person {
p := Person{
- Type: "Person",
- Context: []string{
- "https://www.w3.org/ns/activitystreams",
+ BaseObject: BaseObject{
+ Type: "Person",
+ Context: []string{
+ "https://www.w3.org/ns/activitystreams",
+ },
+ ID: accountRoot,
},
- ID: accountRoot,
URL: accountRoot,
Following: accountRoot + "/following",
Followers: accountRoot + "/followers",
Inbox: accountRoot + "/inbox",
Outbox: accountRoot + "/outbox",
}
return &p
}

File Metadata

Mime Type
text/x-diff
Expires
Wed, Jul 8, 4:21 PM (7 h, 14 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3775190

Event Timeline