Cursor creates a cursor associated with the bucket. The cursor is only valid as long as the transaction is open. Do not use a cursor after the transaction is closed.
()
| 72 | // The cursor is only valid as long as the transaction is open. |
| 73 | // Do not use a cursor after the transaction is closed. |
| 74 | func (b *Bucket) Cursor() *Cursor { |
| 75 | // Update transaction statistics. |
| 76 | b.tx.stats.IncCursorCount(1) |
| 77 | |
| 78 | // Allocate and return a cursor. |
| 79 | return &Cursor{ |
| 80 | bucket: b, |
| 81 | stack: make([]elemRef, 0), |
| 82 | } |
| 83 | } |
| 84 | |
| 85 | // Bucket retrieves a nested bucket by name. |
| 86 | // Returns nil if the bucket does not exist. |
no test coverage detected