summaryrefslogtreecommitdiff
path: root/content/types.go
diff options
context:
space:
mode:
authorSteve Manuel <nilslice@gmail.com>2016-09-20 00:24:31 -0700
committerSteve Manuel <nilslice@gmail.com>2016-09-20 00:24:31 -0700
commitcb545173a6f33aff050a1855dcb87184d50b79a6 (patch)
treea2293c3712af16d5d3b31dd5bb40ae5501e9b7e9 /content/types.go
parent3bbfb755411768fe8557b1e36ec10d65a351793f (diff)
adding support for boltdb storage, updating and inserting content, some reorganization
Diffstat (limited to 'content/types.go')
-rw-r--r--content/types.go18
1 files changed, 16 insertions, 2 deletions
diff --git a/content/types.go b/content/types.go
index 778f742..ede2b58 100644
--- a/content/types.go
+++ b/content/types.go
@@ -1,7 +1,21 @@
package content
-import "github.com/nilslice/cms/management/editor"
+const (
+ // ErrTypeNotRegistered means content type isn't registered (not found in Types map)
+ ErrTypeNotRegistered = `Error:
+There is no type registered for %[1]s
+
+Add this to the file which defines %[1]s{} in the 'content' package:
+--------------------------------------------------------------------------+
+
+func init() {
+ Types["%[1]s"] = func() interface{} { return new(%[1]s) }
+}
+
+--------------------------------------------------------------------------+
+`
+)
// 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]editor.Editable)
+var Types = make(map[string]func() interface{})