ForEach executes a function for each bucket in the root. If the provided function returns an error then the iteration is stopped and the error is returned to the caller.
(fn func(name []byte, b *Bucket) error)
| 154 | // If the provided function returns an error then the iteration is stopped and |
| 155 | // the error is returned to the caller. |
| 156 | func (tx *Tx) ForEach(fn func(name []byte, b *Bucket) error) error { |
| 157 | return tx.root.ForEach(func(k, v []byte) error { |
| 158 | return fn(k, tx.root.Bucket(k)) |
| 159 | }) |
| 160 | } |
| 161 | |
| 162 | // OnCommit adds a handler function to be executed after the transaction successfully commits. |
| 163 | func (tx *Tx) OnCommit(fn func()) { |