diff options
author | Steve Manuel <nilslice@gmail.com> | 2016-10-18 18:37:57 -0700 |
---|---|---|
committer | Steve Manuel <nilslice@gmail.com> | 2016-10-18 18:37:57 -0700 |
commit | 8aeec907a44a986b6c3975f13573b00a0043f67c (patch) | |
tree | 331be5137da43eb944fc6b58f6f96773ccf066b3 | |
parent | d594cbbea7f4297f1b581ad15643125f0db0c561 (diff) |
adding the Touch() method to Sortable interface, which would enable us to sort by updated time
-rw-r--r-- | content/item.go | 5 | ||||
-rw-r--r-- | management/editor/editor.go | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/content/item.go b/content/item.go index 79d0197..f4a5489 100644 --- a/content/item.go +++ b/content/item.go @@ -13,6 +13,11 @@ func (i Item) Time() int64 { return i.Timestamp } +// Touch partially implements the Sortable interface +func (i Item) Touch() int64 { + return i.Updated +} + // ContentID partially implements the Sortable interface func (i Item) ContentID() int { return i.ID diff --git a/management/editor/editor.go b/management/editor/editor.go index 1525ef9..d069047 100644 --- a/management/editor/editor.go +++ b/management/editor/editor.go @@ -19,6 +19,7 @@ type Editable interface { // Sortable ensures data is sortable by time type Sortable interface { Time() int64 + Touch() int64 ContentID() int } |