MCPcopy Index your code
hub / github.com/apache/casbin / NewTransactionBuffer

Function NewTransactionBuffer

transaction_buffer.go:35–40  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.
35func 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.

Callers 1

BeginTransactionMethod · 0.85

Calls 1

CopyMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…