diff options
author | Steve <nilslice@gmail.com> | 2017-03-07 00:01:12 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-07 00:01:12 -0800 |
commit | 87003e7896d014041532b4c3a20842939ed972ea (patch) | |
tree | fc39d65aaeadad2acb1ddb96cae4e525201108bb /system/item | |
parent | 50613a4972b41d650857e88eae65b2a0e11176ce (diff) | |
parent | 986a2130a59b25fdc7730b3a974d5f5338bd7cb1 (diff) |
Merge pull request #92 from kkeuning/ponzu-dev
Allow for external api updates to content items
Diffstat (limited to 'system/item')
-rw-r--r-- | system/item/item.go | 13 |
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 |