diff options
Diffstat (limited to 'system/item')
-rw-r--r-- | system/item/item.go | 13 | ||||
-rw-r--r-- | system/item/types.go | 5 |
2 files changed, 18 insertions, 0 deletions
diff --git a/system/item/item.go b/system/item/item.go index a813669..761b2cf 100644 --- a/system/item/item.go +++ b/system/item/item.go @@ -55,6 +55,19 @@ type Hookable interface { AfterReject(req *http.Request) error } +// Hideable lets a user keep items hidden +type Hideable interface { + Hide(*http.Request) error +} + +// Pushable lets a user define which values of certain struct fields are +// 'pushed' down to a client via HTTP/2 Server Push. All items in the slice +// should be the json tag names of the struct fields to which they coorespond +type Pushable interface { + // the values contained by fields returned by Push must strictly be URL paths + Push() []string +} + // Item should only be embedded into content type structs. type Item struct { UUID uuid.UUID `json:"uuid"` diff --git a/system/item/types.go b/system/item/types.go index 33e9ced..b4b361b 100644 --- a/system/item/types.go +++ b/system/item/types.go @@ -14,6 +14,11 @@ Add this to the file which defines %[1]s{} in the 'content' package: ` + + // AllowHiddenItem should be used as an error to tell a caller of Hideable#Hide + // that this type is hidden, but should be shown in a particular case, i.e. + // if requested by a valid admin or user + AllowHiddenItem = `Allow hidden item` ) // Types is a map used to reference a type name to its actual Editable type |