summaryrefslogtreecommitdiff
path: root/system/item
diff options
context:
space:
mode:
Diffstat (limited to 'system/item')
-rw-r--r--system/item/types.go22
1 files changed, 14 insertions, 8 deletions
diff --git a/system/item/types.go b/system/item/types.go
index b4b361b..b796309 100644
--- a/system/item/types.go
+++ b/system/item/types.go
@@ -1,8 +1,9 @@
package item
+import "errors"
+
const (
- // ErrTypeNotRegistered means content type isn't registered (not found in Types map)
- ErrTypeNotRegistered = `Error:
+ typeNotRegistered = `Error:
There is no type registered for %[1]s
Add this to the file which defines %[1]s{} in the 'content' package:
@@ -14,13 +15,18 @@ 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
+var (
+ // ErrTypeNotRegistered means content type isn't registered (not found in Types map)
+ ErrTypeNotRegistered = errors.New(typeNotRegistered)
+
+ // ErrAllowHiddenItem 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`
-)
+ ErrAllowHiddenItem = errors.New(`Allow hidden item`)
-// Types is a map used to reference a type name to its actual Editable type
-// mainly for lookups in /admin route based utilities
-var Types = make(map[string]func() interface{})
+ // Types is a map used to reference a type name to its actual Editable type
+ // mainly for lookups in /admin route based utilities
+ Types = make(map[string]func() interface{})
+)