NewTransactionBuffer creates a new transaction buffer with a model snapshot. The snapshot represents the state of the model at the beginning of the transaction.
(baseModel model.Model)
| 33 | // NewTransactionBuffer creates a new transaction buffer with a model snapshot. |
| 34 | // The snapshot represents the state of the model at the beginning of the transaction. |
| 35 | func NewTransactionBuffer(baseModel model.Model) *TransactionBuffer { |
| 36 | return &TransactionBuffer{ |
| 37 | operations: make([]persist.PolicyOperation, 0), |
| 38 | modelSnapshot: baseModel.Copy(), |
| 39 | } |
| 40 | } |
| 41 | |
| 42 | // AddOperation adds a policy operation to the buffer. |
| 43 | // This operation will be applied when the transaction is committed. |
no test coverage detected
searching dependent graphs…