summaryrefslogtreecommitdiff
path: root/system/item
diff options
context:
space:
mode:
authorSteve Manuel <nilslice@gmail.com>2017-05-01 01:18:30 -0500
committerSteve Manuel <nilslice@gmail.com>2017-05-01 01:18:30 -0500
commitd991bfd3e75a08ad38710975a2747bae197e5a4e (patch)
tree8f3571c6a63b4b5a73aae83064b6cb1a8c51f00a /system/item
parent85a3a3a7f37b7c459dac824ea837bcb1f5a12d4c (diff)
adding admin action hooks to handlers and hookable interface
Diffstat (limited to 'system/item')
-rw-r--r--system/item/item.go59
1 files changed, 59 insertions, 0 deletions
diff --git a/system/item/item.go b/system/item/item.go
index 961516a..f2e8209 100644
--- a/system/item/item.go
+++ b/system/item/item.go
@@ -56,6 +56,15 @@ type Hookable interface {
BeforeAPIDelete(http.ResponseWriter, *http.Request) error
AfterAPIDelete(http.ResponseWriter, *http.Request) error
+ BeforeAdminCreate(http.ResponseWriter, *http.Request) error
+ AfterAdminCreate(http.ResponseWriter, *http.Request) error
+
+ BeforeAdminUpdate(http.ResponseWriter, *http.Request) error
+ AfterAdminUpdate(http.ResponseWriter, *http.Request) error
+
+ BeforeAdminDelete(http.ResponseWriter, *http.Request) error
+ AfterAdminDelete(http.ResponseWriter, *http.Request) error
+
BeforeSave(http.ResponseWriter, *http.Request) error
AfterSave(http.ResponseWriter, *http.Request) error
@@ -180,6 +189,36 @@ func (i Item) AfterAPIDelete(res http.ResponseWriter, req *http.Request) error {
return nil
}
+// BeforeAdminCreate is a no-op to ensure structs which embed Item implement Hookable
+func (i Item) BeforeAdminCreate(res http.ResponseWriter, req *http.Request) error {
+ return nil
+}
+
+// AfterAdminCreate is a no-op to ensure structs which embed Item implement Hookable
+func (i Item) AfterAdminCreate(res http.ResponseWriter, req *http.Request) error {
+ return nil
+}
+
+// BeforeAdminUpdate is a no-op to ensure structs which embed Item implement Hookable
+func (i Item) BeforeAdminUpdate(res http.ResponseWriter, req *http.Request) error {
+ return nil
+}
+
+// AfterAdminUpdate is a no-op to ensure structs which embed Item implement Hookable
+func (i Item) AfterAdminUpdate(res http.ResponseWriter, req *http.Request) error {
+ return nil
+}
+
+// BeforeAdminDelete is a no-op to ensure structs which embed Item implement Hookable
+func (i Item) BeforeAdminDelete(res http.ResponseWriter, req *http.Request) error {
+ return nil
+}
+
+// AfterAdminDelete is a no-op to ensure structs which embed Item implement Hookable
+func (i Item) AfterAdminDelete(res http.ResponseWriter, req *http.Request) error {
+ return nil
+}
+
// BeforeSave is a no-op to ensure structs which embed Item implement Hookable
func (i Item) BeforeSave(res http.ResponseWriter, req *http.Request) error {
return nil
@@ -220,6 +259,26 @@ func (i Item) AfterReject(res http.ResponseWriter, req *http.Request) error {
return nil
}
+// BeforeEnable is a no-op to ensure structs which embed Item implement Hookable
+func (i Item) BeforeEnable(res http.ResponseWriter, req *http.Request) error {
+ return nil
+}
+
+// AfterEnable is a no-op to ensure structs which embed Item implement Hookable
+func (i Item) AfterEnable(res http.ResponseWriter, req *http.Request) error {
+ return nil
+}
+
+// BeforeDisable is a no-op to ensure structs which embed Item implement Hookable
+func (i Item) BeforeDisable(res http.ResponseWriter, req *http.Request) error {
+ return nil
+}
+
+// AfterDisable is a no-op to ensure structs which embed Item implement Hookable
+func (i Item) AfterDisable(res http.ResponseWriter, req *http.Request) error {
+ return nil
+}
+
// SearchMapping returns a default implementation of a Bleve IndexMappingImpl
// partially implements search.Searchable
func (i Item) SearchMapping() (*mapping.IndexMappingImpl, error) {