summaryrefslogtreecommitdiff
path: root/system/db/query.go
diff options
context:
space:
mode:
authorSteve Manuel <nilslice@gmail.com>2016-09-21 03:44:24 -0700
committerSteve Manuel <nilslice@gmail.com>2016-09-21 03:44:24 -0700
commitf3c68b123f426cb83955a78593ce7cc5b346128c (patch)
tree41ea67c1959451f4f507fd7f3a019f4658c4412b /system/db/query.go
parent2c84dd21f24fe68ccd0b0cfcb0d7cb683701ef8b (diff)
added admin interface and overview of content and types. more code reorganization.
Diffstat (limited to 'system/db/query.go')
-rw-r--r--system/db/query.go17
1 files changed, 16 insertions, 1 deletions
diff --git a/system/db/query.go b/system/db/query.go
index 06e9c62..fd526f8 100644
--- a/system/db/query.go
+++ b/system/db/query.go
@@ -160,6 +160,21 @@ func Get(target string) ([]byte, error) {
// GetAll retrives all items from the database within the provided namespace
func GetAll(namespace string) [][]byte {
+ var posts [][]byte
+ store.View(func(tx *bolt.Tx) error {
+ b := tx.Bucket([]byte(namespace))
- return nil
+ len := b.Stats().KeyN
+ posts = make([][]byte, 0, len)
+
+ b.ForEach(func(k, v []byte) error {
+ posts = append(posts, v)
+
+ return nil
+ })
+
+ return nil
+ })
+
+ return posts
}