~whereswaldon/forest-go

ref: cd38454fdf9fbb4c51ccaadbaf43266f3044be1d forest-go/store/store_test.go -rw-r--r-- 7.6 KiB
feat: reorganize Store implementations into new package
feat: testutil: create utility pkg for easier testing
Merge branch 'master' into grove-add
Remove unused Size() method from Store interface
Merge branch 'list-store'
Merge remote-tracking branch 'github/expand-store'
Add Recent method to Store interface
Test expansions to store interface
Add tests for cache warming
Add better tests for CacheStore

This involved creating a new Store operation, as the CacheStore needs
to ensure a level of consistency between the two layers of store that
it manages. The stores now have a CopyInto() method that causes one
store to replicate its content into another. The reason this approach
was taken over providing a way to iterate over the keys was to allow
stores to use their own internal representation of a given node ID as
a key. Providing a Keys() method would require all implementations to
use the same transformation from *fields.QualifiedHash to key type.
Add tests for CacheStore
Implement CacheStore and unify has/get operations
Finish implementing simple in-memory node store
Start implmenting in-memory node store

The Store is a glorified Map that persists Nodes. The goal with the
Store interface is to be implementable both as a memory-backed storage
and a file-backed storage.

Creating it led me to also create the
Node interface that gathers operations that all node types support.
The Node interface is missing a few methods right now, but they'll
be added as they are needed.