25 lines
1.7 KiB
Go
25 lines
1.7 KiB
Go
package ap
|
|
|
|
import "net/url"
|
|
|
|
// Ordered collection of things (paged)
|
|
type OrderedCollection struct {
|
|
Context map[string]any `json:"@context"` // Big chunk of hopefully don't give a fuck
|
|
ID url.URL `json:"id"` // URL to this resource
|
|
Type string `json:"type"` // Should always be "OrderedCollection"
|
|
TotalItems *int `json:"totalItems,omitempty"` // Number of resources in this collection, Akoma doesn't include this
|
|
First url.URL `json:"first"` // Link to the first resource in this collection, an OrderedCollectionPage object
|
|
Last url.URL `json:"last"` // Link to the last resource in this collection, an OrderedCollectionPage object
|
|
}
|
|
|
|
// One page of an ordered collection
|
|
type OrderedCollectionPage struct {
|
|
Context map[string]any `json:"@context"` // Big chunk of hopefully don't give a fuck
|
|
ID url.URL `json:"id"` // URL to this resource
|
|
PartOf url.URL `json:"partOf"` // URL to the collection this is a part of
|
|
Type string `json:"type"` // Should always be "OrderedCollectionPage"
|
|
TotalItems *int `json:"totalItems,omitempty"` // Number of resources in this collection. Mk yes, Masto no, Akoma no
|
|
OrderedItems []map[string]any `json:"orderedItems"` // Items in this list. Should all be AP objects/actions
|
|
Previous *url.URL `json:"prev"` // Previous page, empty if no items? I think?
|
|
Next *url.URL `json:"next"` // Next page
|
|
}
|