35 lines
1016 B
Go
35 lines
1016 B
Go
package activitystreams
|
|||
|
|
|
||
|
|
type Person struct {
|
||
|
|
Context []string `json:"@context"`
|
||
|
|
Type string `json:"type"`
|
||
|
|
ID string `json:"id"`
|
||
|
|
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",
|
||
|
|
},
|
||
|
|
ID: accountRoot,
|
||
|
|
URL: accountRoot,
|
||
|
|
Following: accountRoot + "/following",
|
||
|
|
Followers: accountRoot + "/followers",
|
||
|
|
Inbox: accountRoot + "/inbox",
|
||
|
|
Outbox: accountRoot + "/outbox",
|
||
|
|
}
|
||
|
|
|
||
|
|
return &p
|
||
|
|
}
|