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) NewDefaultPluginsDataChangeTxn() defaultplugins.DataChangeDSL
- func (t *TxnTracker) NewDefaultPluginsDataResyncTxn() defaultplugins.DataResyncDSL
- func (t *TxnTracker) NewLinuxDataChangeTxn() linux.DataChangeDSL
- func (t *TxnTracker) NewLinuxDataResyncTxn() linux.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 *linuxplugin.MockDataResyncDSL // LinuxDataChangeTxn is non-nil for Linux Plugin's Data Change transaction. LinuxDataChangeTxn *linuxplugin.MockDataChangeDSL // DefaultPluginsDataResyncTxn is non-nil for Default Plugins's Data Resync transaction. DefaultPluginsDataResyncTxn *mockdefaultplugins.MockDataResyncDSL // DefaultPluginsDataChangeTxn is non-nil for Default Plugin's Data Change transaction. DefaultPluginsDataChangeTxn *mockdefaultplugins.MockDataChangeDSL }
Txn stores all information about a transaction. Exactly one of the fields is non-nil.
type TxnTracker ¶
type TxnTracker struct { // AppliedConfig represents the current state of the mock DB. AppliedConfig ConfigSnapshot // 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) 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) NewDefaultPluginsDataChangeTxn ¶
func (t *TxnTracker) NewDefaultPluginsDataChangeTxn() defaultplugins.DataChangeDSL
NewDefaultPluginsDataChangeTxn is a factory for Default Plugins's DataChange transactions.
func (*TxnTracker) NewDefaultPluginsDataResyncTxn ¶
func (t *TxnTracker) NewDefaultPluginsDataResyncTxn() defaultplugins.DataResyncDSL
NewDefaultPluginsDataResyncTxn is a factory for default plugins's RESYNC transactions.
func (*TxnTracker) NewLinuxDataChangeTxn ¶
func (t *TxnTracker) NewLinuxDataChangeTxn() linux.DataChangeDSL
NewLinuxDataChangeTxn is a factory for DataChange transactions.
func (*TxnTracker) NewLinuxDataResyncTxn ¶
func (t *TxnTracker) NewLinuxDataResyncTxn() linux.DataResyncDSL
NewLinuxDataResyncTxn is a factory for Linux Plugins's RESYNC transactions.
Directories ¶
Path | Synopsis |
---|---|
Package dsl is base package for mocks of DSL transaction creators.
|
Package dsl is base package for mocks of DSL transaction creators. |