29 lines
544 B
Go
29 lines
544 B
Go
package mdb
|
|
|
|
type WALStatus struct {
|
|
MaxSeqNumKV uint64
|
|
MaxSeqNumWAL uint64
|
|
}
|
|
|
|
type itemIndex[T any] interface {
|
|
load(m map[uint64]*T) error
|
|
insert(*T)
|
|
update(old, new *T) // Old and new MUST have the same ID.
|
|
delete(*T)
|
|
}
|
|
|
|
type itemUniqueIndex[T any] interface {
|
|
load(m map[uint64]*T) error
|
|
name() string
|
|
lock(*T)
|
|
unlock(*T)
|
|
insertConflict(*T) bool
|
|
updateConflict(*T) bool
|
|
}
|
|
|
|
type dbCollection interface {
|
|
loadData()
|
|
onStore(string, uint64, []byte) // For WAL following.
|
|
onDelete(string, uint64) // For WAL following.
|
|
}
|