MCPcopy Create free account
hub / github.com/ByteStorage/FlyDB / NewLogInMemStorage

Function NewLogInMemStorage

lib/datastore/inmem.go:25–32  ·  view source on GitHub ↗

NewLogInMemStorage is a function that creates a new in-memory store It returns a raft.LogStore and an error

(conf config.Config)

Source from the content-addressed store, hash-verified

23// NewLogInMemStorage is a function that creates a new in-memory store
24// It returns a raft.LogStore and an error
25func NewLogInMemStorage(conf config.Config) (DataStore, error) {
26 a := &InMemStore{
27 logs: make(map[uint64]*raft.Log),
28 kv: map[string][]byte{},
29 kvUint: map[string]uint64{},
30 }
31 return a, nil
32}
33
34// FirstIndex is a method on InMemStore that returns the first index in the log
35func (ds *InMemStore) FirstIndex() (uint64, error) {

Callers 1

testMemoryDatastoreFunction · 0.85

Calls

no outgoing calls

Tested by 1

testMemoryDatastoreFunction · 0.68