summaryrefslogtreecommitdiff
path: root/content
diff options
context:
space:
mode:
authorSteve Manuel <nilslice@gmail.com>2016-11-28 15:14:56 -0800
committerSteve Manuel <nilslice@gmail.com>2016-11-28 15:14:56 -0800
commit556bec10bc70e33660c5c0801fe9452e226fabc8 (patch)
tree948a0498a21524deba4dc73b1aa2d3cc91a3bbf9 /content
parent553235a85fd013ae91173f15ec74503347573cd6 (diff)
adding uuid dep and implementation for content.Item
Diffstat (limited to 'content')
-rw-r--r--content/item.go18
1 files changed, 11 insertions, 7 deletions
diff --git a/content/item.go b/content/item.go
index c847ed7..4583c07 100644
--- a/content/item.go
+++ b/content/item.go
@@ -1,6 +1,10 @@
package content
-import "net/http"
+import (
+ "net/http"
+
+ uuid "github.com/satori/go.uuid"
+)
// Sluggable makes a struct locatable by URL with it's own path
// As an Item implementing Sluggable, slugs may overlap. If this is an issue,
@@ -35,13 +39,13 @@ type Hookable interface {
AfterReject(req *http.Request) error
}
-
// Item should only be embedded into content type structs.
type Item struct {
- ID int `json:"id"`
- Slug string `json:"slug"`
- Timestamp int64 `json:"timestamp"`
- Updated int64 `json:"updated"`
+ UUID uuid.UUID `json:"uuid"`
+ ID int `json:"id"`
+ Slug string `json:"slug"`
+ Timestamp int64 `json:"timestamp"`
+ Updated int64 `json:"updated"`
}
// Time partially implements the Sortable interface
@@ -107,4 +111,4 @@ func (i Item) BeforeReject(req *http.Request) error {
// AfterReject is a no-op to ensure structs which embed Item implement Hookable
func (i Item) AfterReject(req *http.Request) error {
return nil
-} \ No newline at end of file
+}