From f47826071f1e6d7b048d1304d8435a347f9b412a Mon Sep 17 00:00:00 2001 From: Steve Manuel Date: Mon, 13 Feb 2017 09:18:36 -0800 Subject: adding item.Omittable interface for field-level omission of data in responses, implementation in handler and separating source into individual files for other interface impls --- system/item/item.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'system/item') diff --git a/system/item/item.go b/system/item/item.go index f35d7f6..4a219c8 100644 --- a/system/item/item.go +++ b/system/item/item.go @@ -71,6 +71,14 @@ type Pushable interface { Push() []string } +// Omittable lets a user define certin fields within a content struct to remove +// from an API response. Helpful when you want data in the CMS, but not entirely +// shown or available from the content API. All items in the slice should be the +// json tag names of the struct fields to which they coorespond. +type Omittable interface { + Omit() []string +} + // Item should only be embedded into content type structs. type Item struct { UUID uuid.UUID `json:"uuid"` -- cgit v1.2.3