diff options
Diffstat (limited to 'system/item')
-rw-r--r-- | system/item/item.go | 59 |
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) { |