MCPcopy Create free account
hub / github.com/nutsdb/nutsdb / newTx

Function newTx

tx.go:88–100  ·  view source on GitHub ↗

newTx returns a newly initialized Tx object at given writable.

(db *DB, writable bool)

Source from the content-addressed store, hash-verified

86
87// newTx returns a newly initialized Tx object at given writable.
88func newTx(db *DB, writable bool) (tx *Tx, err error) {
89 tx = &Tx{
90 db: db,
91 writable: writable,
92 pendingWrites: newPendingEntriesList(),
93 pendingBucketList: make(map[core.Ds]map[core.BucketName]*core.Bucket),
94 }
95 tx.setStatusRunning()
96
97 tx.id = tx.getTxID()
98
99 return
100}
101
102func (tx *Tx) CommitWith(cb func(error)) {
103 if cb == nil {

Callers 1

BeginTxMethod · 0.85

Calls 3

newPendingEntriesListFunction · 0.85
setStatusRunningMethod · 0.80
getTxIDMethod · 0.80

Tested by

no test coverage detected