summaryrefslogtreecommitdiff
path: root/system/item
diff options
context:
space:
mode:
authorKevin Keuning <kkeuning@gmail.com>2017-03-02 12:48:17 -0600
committerKevin Keuning <kkeuning@gmail.com>2017-03-02 12:48:17 -0600
commit6358ca512c227b8f035401b57543e0190c635e8d (patch)
treec48b2ea31d4125c1783a3ccf47a3972e3479c219 /system/item
parenta7db36aa56c1998bc56d593a38f2a1640a9298a0 (diff)
added UpdateContent for merge behavior on api updates, extended Hookable
Diffstat (limited to 'system/item')
-rw-r--r--system/item/item.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/system/item/item.go b/system/item/item.go
index 5b41693..286842b 100644
--- a/system/item/item.go
+++ b/system/item/item.go
@@ -42,6 +42,9 @@ type Sortable interface {
// to the different lifecycles/events a struct may encounter. Item implements
// Hookable with no-ops so our user can override only whichever ones necessary.
type Hookable interface {
+ BeforeAcceptUpdate(http.ResponseWriter, *http.Request) error
+ AfterAcceptUpdate(http.ResponseWriter, *http.Request) error
+
BeforeAccept(http.ResponseWriter, *http.Request) error
AfterAccept(http.ResponseWriter, *http.Request) error
@@ -132,6 +135,16 @@ func (i Item) String() string {
return fmt.Sprintf("Item ID: %s", i.UniqueID())
}
+// BeforeAcceptUpdate is a no-op to ensure structs which embed Item implement Hookable
+func (i Item) BeforeAcceptUpdate(res http.ResponseWriter, req *http.Request) error {
+ return nil
+}
+
+// AfterAcceptUpdate is a no-op to ensure structs which embed Item implement Hookable
+func (i Item) AfterAcceptUpdate(res http.ResponseWriter, req *http.Request) error {
+ return nil
+}
+
// BeforeAccept is a no-op to ensure structs which embed Item implement Hookable
func (i Item) BeforeAccept(res http.ResponseWriter, req *http.Request) error {
return nil