Documentation ¶
Overview ¶
Package localclient contains mocks for transactions created by DSL structures in localclient packages.
Index ¶
- type ConfigSnapshot
- type Txn
- type TxnTracker
- func (t *TxnTracker) Clear()
- func (t *TxnTracker) NewLinuxDataChangeTxn() linuxclient.DataChangeDSL
- func (t *TxnTracker) NewLinuxDataResyncTxn() linuxclient.DataResyncDSL
- func (t *TxnTracker) NewVPPDataChangeTxn() vppclient.DataChangeDSL
- func (t *TxnTracker) NewVPPDataResyncTxn() vppclient.DataResyncDSL
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigSnapshot ¶
ConfigSnapshot represents the current state of a mock DB.
type Txn ¶
type Txn struct { // LinuxDataResyncTxn is non-nil for Linux Plugin's RESYNC transaction. LinuxDataResyncTxn *mocklinux.MockDataResyncDSL // LinuxDataChangeTxn is non-nil for Linux Plugin's Data Change transaction. LinuxDataChangeTxn *mocklinux.MockDataChangeDSL // VPPDataResyncTxn is non-nil for VPP Plugins's Data Resync transaction. VPPDataResyncTxn *mockvpp.MockDataResyncDSL // VPPDataChangeTxn is non-nil for VPP Plugin's Data Change transaction. VPPDataChangeTxn *mockvpp.MockDataChangeDSL }
Txn stores all information about a transaction. Exactly one of the fields is non-nil.
type TxnTracker ¶
type TxnTracker struct { // LatestRevisions maintains the map of keys & values with revision. LatestRevisions *syncbase.PrevRevisions // CommittedTxns is a list finalized transaction in the order as they were // committed. CommittedTxns []*Txn // PendingTxns is map of pending (uncommitted) transactions. PendingTxns map[*Txn]struct{} // contains filtered or unexported fields }
TxnTracker tracks all transactions executed or pending in the mock localclient.
func NewTxnTracker ¶
func NewTxnTracker(onCommit func(txn *Txn, latestRevs *syncbase.PrevRevisions) error) *TxnTracker
NewTxnTracker is a constructor for TxnTracker. It is the entry-point to the mock localclient for both linux and vpp.
func (*TxnTracker) Clear ¶
func (t *TxnTracker) Clear()
Clear clears the TxnTracker state. Already created transactions become invalid.
func (*TxnTracker) NewLinuxDataChangeTxn ¶
func (t *TxnTracker) NewLinuxDataChangeTxn() linuxclient.DataChangeDSL
NewLinuxDataChangeTxn is a factory for DataChange transactions.
func (*TxnTracker) NewLinuxDataResyncTxn ¶
func (t *TxnTracker) NewLinuxDataResyncTxn() linuxclient.DataResyncDSL
NewLinuxDataResyncTxn is a factory for Linux Plugins's RESYNC transactions.
func (*TxnTracker) NewVPPDataChangeTxn ¶
func (t *TxnTracker) NewVPPDataChangeTxn() vppclient.DataChangeDSL
NewVPPDataChangeTxn is a factory for VPP Plugins's DataChange transactions.
func (*TxnTracker) NewVPPDataResyncTxn ¶
func (t *TxnTracker) NewVPPDataResyncTxn() vppclient.DataResyncDSL
NewVPPDataResyncTxn is a factory for VPP plugins's RESYNC transactions.