MCPcopy Index your code
hub / github.com/SpectoLabs/hoverfly / GetAllKeys

Method GetAllKeys

core/cache/boltdb_cache.go:164–182  ·  view source on GitHub ↗

GetAllKeys - gets all current keys

()

Source from the content-addressed store, hash-verified

162
163// GetAllKeys - gets all current keys
164func (c *BoltCache) GetAllKeys() (keys map[string]bool, err error) {
165 err = c.DS.View(func(tx *bolt.Tx) error {
166 b := tx.Bucket(c.CurrentBucket)
167
168 keys = make(map[string]bool)
169
170 if b == nil {
171 // bucket doesn't exist
172 return nil
173 }
174 c := b.Cursor()
175
176 for k, _ := c.First(); k != nil; k, _ = c.Next() {
177 keys[string(k)] = true
178 }
179 return nil
180 })
181 return
182}
183
184// GetDB - returns open BoltDB database with read/write permissions or goes down in flames if
185// something bad happends

Callers

nothing calls this directly

Calls 1

ViewMethod · 0.65

Tested by

no test coverage detected