Core components of the web application. https://write.as
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

35 rader
926 B

  1. package activitystreams
  2. type Person struct {
  3. BaseObject
  4. Inbox string `json:"inbox"`
  5. Outbox string `json:"outbox"`
  6. PreferredUsername string `json:"preferredUsername"`
  7. URL string `json:"url"`
  8. Name string `json:"name"`
  9. Icon Image `json:"icon"`
  10. Following string `json:"following"`
  11. Followers string `json:"followers"`
  12. Summary string `json:"summary"`
  13. PublicKey PublicKey `json:"publicKey"`
  14. }
  15. func NewPerson(accountRoot string) *Person {
  16. p := Person{
  17. BaseObject: BaseObject{
  18. Type: "Person",
  19. Context: []string{
  20. "https://www.w3.org/ns/activitystreams",
  21. },
  22. ID: accountRoot,
  23. },
  24. URL: accountRoot,
  25. Following: accountRoot + "/following",
  26. Followers: accountRoot + "/followers",
  27. Inbox: accountRoot + "/inbox",
  28. Outbox: accountRoot + "/outbox",
  29. }
  30. return &p
  31. }