GetOperations returns all buffered operations. Returns a copy to prevent external modifications.
()
| 50 | // GetOperations returns all buffered operations. |
| 51 | // Returns a copy to prevent external modifications. |
| 52 | func (tb *TransactionBuffer) GetOperations() []persist.PolicyOperation { |
| 53 | tb.mutex.RLock() |
| 54 | defer tb.mutex.RUnlock() |
| 55 | |
| 56 | // Return a copy to prevent external modifications. |
| 57 | result := make([]persist.PolicyOperation, len(tb.operations)) |
| 58 | copy(result, tb.operations) |
| 59 | return result |
| 60 | } |
| 61 | |
| 62 | // Clear removes all buffered operations. |
| 63 | // This is typically called after a successful commit or rollback. |
no outgoing calls
no test coverage detected