GetAllValues - returns all values
()
| 66 | |
| 67 | // GetAllValues - returns all values |
| 68 | func (c *BoltCache) GetAllValues() (values [][]byte, err error) { |
| 69 | err = c.DS.View(func(tx *bolt.Tx) error { |
| 70 | b := tx.Bucket(c.CurrentBucket) |
| 71 | if b == nil { |
| 72 | // bucket doesn't exist |
| 73 | return nil |
| 74 | } |
| 75 | c := b.Cursor() |
| 76 | |
| 77 | for k, v := c.First(); k != nil; k, v = c.Next() { |
| 78 | var buffer bytes.Buffer |
| 79 | buffer.Write(v) |
| 80 | values = append(values, buffer.Bytes()) |
| 81 | } |
| 82 | return nil |
| 83 | }) |
| 84 | return |
| 85 | } |
| 86 | |
| 87 | // GetAllEntries - returns all keys/values |
| 88 | func (c *BoltCache) GetAllEntries() (values map[string][]byte, err error) { |