Update godoc string for memdb wrapper functions/structs

This commit is contained in:
Chris Piraino 2020-09-02 10:24:22 -05:00
parent d301145e62
commit a3028cad89
1 changed files with 5 additions and 3 deletions

View File

@ -31,8 +31,9 @@ type Changes struct {
} }
// changeTrackerDB is a thin wrapper around memdb.DB which enables TrackChanges on // changeTrackerDB is a thin wrapper around memdb.DB which enables TrackChanges on
// all write transactions. When the transaction is committed the changes are // all write transactions. When the transaction is committed the changes are:
// sent to the eventPublisher which will create and emit change events. // 1. Used to update our internal usage tracking
// 2. Sent to the eventPublisher which will create and emit change events
type changeTrackerDB struct { type changeTrackerDB struct {
db *memdb.MemDB db *memdb.MemDB
publisher eventPublisher publisher eventPublisher
@ -100,7 +101,8 @@ func (c *changeTrackerDB) publish(changes Changes) error {
// Restore where we need to replace the entire contents of the Store. // Restore where we need to replace the entire contents of the Store.
// WriteTxnRestore uses a zero index since the whole restore doesn't really // WriteTxnRestore uses a zero index since the whole restore doesn't really
// occur at one index - the effect is to write many values that were previously // occur at one index - the effect is to write many values that were previously
// written across many indexes. // written across many indexes. WriteTxnRestore also does not publish any
// change events to subscribers.
func (c *changeTrackerDB) WriteTxnRestore() *txn { func (c *changeTrackerDB) WriteTxnRestore() *txn {
t := &txn{ t := &txn{
Txn: c.db.Txn(true), Txn: c.db.Txn(true),