From 255c182d32cd8e9d243142ab08ef4865375a5e7c Mon Sep 17 00:00:00 2001 From: Steve Manuel Date: Tue, 8 Nov 2016 18:15:09 -0800 Subject: adding remaining interface methods to satisfy Hookable. Reverting back again to value receiver as it is clearer about Hookable methods and ability to modifty struct fields --- content/item.go | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/content/item.go b/content/item.go index cbf38af..14717bb 100644 --- a/content/item.go +++ b/content/item.go @@ -36,32 +36,42 @@ func (i *Item) SetItemID(id int) { } // BeforeSave is a no-op to ensure structs which embed Item implement Hookable -func (i *Item) BeforeSave(req *http.Request) error { +func (i Item) BeforeSave(req *http.Request) error { return nil } // AfterSave is a no-op to ensure structs which embed Item implement Hookable -func (i *Item) AfterSave(req *http.Request) error { +func (i Item) AfterSave(req *http.Request) error { return nil } // BeforeDelete is a no-op to ensure structs which embed Item implement Hookable -func (i *Item) BeforeDelete(req *http.Request) error { +func (i Item) BeforeDelete(req *http.Request) error { return nil } // AfterDelete is a no-op to ensure structs which embed Item implement Hookable -func (i *Item) AfterDelete(req *http.Request) error { +func (i Item) AfterDelete(req *http.Request) error { + return nil +} + +// BeforeApprove is a no-op to ensure structs which embed Item implement Hookable +func (i Item) BeforeApprove(req *http.Request) error { + return nil +} + +// AfterApprove is a no-op to ensure structs which embed Item implement Hookable +func (i Item) AfterApprove(req *http.Request) error { return nil } // BeforeReject is a no-op to ensure structs which embed Item implement Hookable -func (i *Item) BeforeReject(req *http.Request) error { +func (i Item) BeforeReject(req *http.Request) error { return nil } // AfterReject is a no-op to ensure structs which embed Item implement Hookable -func (i *Item) AfterReject(req *http.Request) error { +func (i Item) AfterReject(req *http.Request) error { return nil } -- cgit v1.2.3