summaryrefslogtreecommitdiff
path: root/content/item.go
diff options
context:
space:
mode:
authorSteve <nilslice@gmail.com>2016-10-19 00:09:28 -0700
committerGitHub <noreply@github.com>2016-10-19 00:09:28 -0700
commit0c77f3e89ac26913ce4b7de68fe9f5589ae77d8f (patch)
tree859e76f6d1335133ba8f62da72f068e79331880c /content/item.go
parent2f3985491363dc0658ad8cf3a415a77c1825a67a (diff)
parentc74bcc2ec1be59ded3634de1a871c73d9dffba98 (diff)
Merge pull request #3 from bosssauce/ponzu-dev
[fundamental feature] Content type posts are sorted by time and cached in Admin, API coming soon.
Diffstat (limited to 'content/item.go')
-rw-r--r--content/item.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/content/item.go b/content/item.go
index 7b25b14..f4a5489 100644
--- a/content/item.go
+++ b/content/item.go
@@ -7,3 +7,18 @@ type Item struct {
Timestamp int64 `json:"timestamp"`
Updated int64 `json:"updated"`
}
+
+// Time partially implements the Sortable interface
+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
+}