diff options
author | Steve <nilslice@gmail.com> | 2016-12-06 15:24:36 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-06 15:24:36 -0800 |
commit | f39c1519ab382a343c05163f00f38c83bff3583d (patch) | |
tree | 254f75834f2cb787179f7880b0063e667d8ad234 /content/item.go | |
parent | 5527117e706114c1188afaa10188d96170874047 (diff) | |
parent | 64050ef8065bccdef0aab1748040995c637fe9ed (diff) |
Merge pull request #19 from bosssauce/ponzu-dev
[core] Added account recovery process and content pagination in admin UI
Diffstat (limited to 'content/item.go')
-rw-r--r-- | content/item.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/content/item.go b/content/item.go index 9eb3c16..e6c8243 100644 --- a/content/item.go +++ b/content/item.go @@ -1,6 +1,7 @@ package content import ( + "fmt" "net/http" uuid "github.com/satori/go.uuid" @@ -22,6 +23,7 @@ type Identifiable interface { ItemID() int SetItemID(int) UniqueID() uuid.UUID + String() string } // Hookable provides our user with an easy way to intercept or add functionality @@ -83,6 +85,12 @@ func (i Item) UniqueID() uuid.UUID { return i.UUID } +// String formats an Item into a printable value +// partially implements the Identifiable interface +func (i Item) String() string { + return fmt.Sprintf("Item ID: %s", i.UniqueID()) +} + // BeforeSave is a no-op to ensure structs which embed Item implement Hookable func (i Item) BeforeSave(req *http.Request) error { return nil |