diff options
author | KushBlazingJudah <59340248+KushBlazingJudah@users.noreply.github.com> | 2021-11-02 14:55:59 -0300 |
---|---|---|
committer | FChannel <> | 2022-06-19 12:53:29 -0700 |
commit | 36a41e03c59624a2b4a7eb174e9a003e288a1d7d (patch) | |
tree | 149c72f53b4fe41308ebc1624ed46037760254e0 /activitypub/activityPubStruct.go | |
parent | fbf9732a7a7a599fdc35b7e9e2072d32d2ea9d33 (diff) |
restructuring, part 4 of many
Diffstat (limited to 'activitypub/activityPubStruct.go')
-rw-r--r-- | activitypub/activityPubStruct.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/activitypub/activityPubStruct.go b/activitypub/activityPubStruct.go index 002d514..637982d 100644 --- a/activitypub/activityPubStruct.go +++ b/activitypub/activityPubStruct.go @@ -204,3 +204,15 @@ type Collection struct { AtContext CollectionBase } + +type ObjectBaseSortDesc []ObjectBase + +func (a ObjectBaseSortDesc) Len() int { return len(a) } +func (a ObjectBaseSortDesc) Less(i, j int) bool { return a[i].Updated.After(a[j].Updated) } +func (a ObjectBaseSortDesc) Swap(i, j int) { a[i], a[j] = a[j], a[i] } + +type ObjectBaseSortAsc []ObjectBase + +func (a ObjectBaseSortAsc) Len() int { return len(a) } +func (a ObjectBaseSortAsc) Less(i, j int) bool { return a[i].Published.Before(a[j].Published) } +func (a ObjectBaseSortAsc) Swap(i, j int) { a[i], a[j] = a[j], a[i] } |