Add BaseObject

This commit is contained in:
Matt Baer
2018-06-22 17:11:07 -04:00
parent e99c8d6b4d
commit e7db291bd3
2 changed files with 35 additions and 7 deletions
+7 -7
View File
@@ -1,9 +1,7 @@
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"`
@@ -18,11 +16,13 @@ type Person struct {
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",