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

Method GetAllEntries

core/cache/boltdb_cache.go:88–107  ·  view source on GitHub ↗

GetAllEntries - returns all keys/values

()

Source from the content-addressed store, hash-verified

86
87// GetAllEntries - returns all keys/values
88func (c *BoltCache) GetAllEntries() (values map[string][]byte, err error) {
89 err = c.DS.View(func(tx *bolt.Tx) error {
90 b := tx.Bucket(c.CurrentBucket)
91 if b == nil {
92 // bucket doesn't exist
93 return nil
94 }
95 c := b.Cursor()
96
97 values = make(map[string][]byte)
98
99 for k, v := c.First(); k != nil; k, v = c.Next() {
100 var buffer bytes.Buffer
101 buffer.Write(v)
102 values[string(k)] = buffer.Bytes()
103 }
104 return nil
105 })
106 return
107}
108
109// RecordsCount - returns records count
110func (c *BoltCache) RecordsCount() (count int, err error) {

Callers

nothing calls this directly

Calls 1

ViewMethod · 0.65

Tested by

no test coverage detected