RecordsCount - returns records count
()
| 108 | |
| 109 | // RecordsCount - returns records count |
| 110 | func (c *BoltCache) RecordsCount() (count int, err error) { |
| 111 | err = c.DS.View(func(tx *bolt.Tx) error { |
| 112 | b := tx.Bucket(c.CurrentBucket) |
| 113 | if b == nil { |
| 114 | // bucket doesn't exist |
| 115 | return nil |
| 116 | } |
| 117 | |
| 118 | count = b.Stats().KeyN |
| 119 | |
| 120 | return nil |
| 121 | }) |
| 122 | return |
| 123 | } |
| 124 | |
| 125 | // Delete - deletes specified key |
| 126 | func (c *BoltCache) Delete(key []byte) error { |