Files
web-core-fr-gp/activitystreams/data.go
T

44 lines
941 B
Go
Raw Normal View History

2018-06-22 16:42:38 -04:00
package activitystreams
type (
2018-06-22 17:11:07 -04:00
BaseObject struct {
Context []string `json:"@context"`
Type string `json:"type"`
ID string `json:"id"`
}
2018-06-22 16:42:38 -04:00
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"`
}
)
2018-06-22 17:11:07 -04:00
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
}