newTx returns a newly initialized Tx object at given writable.
(db *DB, writable bool)
| 86 | |
| 87 | // newTx returns a newly initialized Tx object at given writable. |
| 88 | func 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 | |
| 102 | func (tx *Tx) CommitWith(cb func(error)) { |
| 103 | if cb == nil { |
no test coverage detected