summaryrefslogtreecommitdiff
path: root/system/item
diff options
context:
space:
mode:
authorSteve Manuel <nilslice@gmail.com>2017-02-13 09:18:36 -0800
committerSteve Manuel <nilslice@gmail.com>2017-02-13 09:18:36 -0800
commitf47826071f1e6d7b048d1304d8435a347f9b412a (patch)
tree1990862ba77dfce49325cc39c017a76a97c366c5 /system/item
parent6ea648ae4306e64f5562ca363e0cdea494ba8d46 (diff)
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
Diffstat (limited to 'system/item')
-rw-r--r--system/item/item.go8
1 files changed, 8 insertions, 0 deletions
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"`