Documentation ¶
Index ¶
- type ConfigSnapshot
- type MockDataChangeDSL
- type MockDataResyncDSL
- func (dsl *MockDataResyncDSL) ACL(val *acl.AccessLists_Acl) linux.DataResyncDSL
- func (dsl *MockDataResyncDSL) BD(val *l2.BridgeDomains_BridgeDomain) linux.DataResyncDSL
- func (dsl *MockDataResyncDSL) BDFIB(val *l2.FibTableEntries_FibTableEntry) linux.DataResyncDSL
- func (dsl *MockDataResyncDSL) BfdAuthKeys(val *bfd.SingleHopBFD_Key) linux.DataResyncDSL
- func (dsl *MockDataResyncDSL) BfdEchoFunction(val *bfd.SingleHopBFD_EchoFunction) linux.DataResyncDSL
- func (dsl *MockDataResyncDSL) BfdSession(val *bfd.SingleHopBFD_Session) linux.DataResyncDSL
- func (dsl *MockDataResyncDSL) LinuxArpEntry(val *linux_l3.LinuxStaticArpEntries_ArpEntry) linux.DataResyncDSL
- func (dsl *MockDataResyncDSL) LinuxInterface(val *linux_intf.LinuxInterfaces_Interface) linux.DataResyncDSL
- func (dsl *MockDataResyncDSL) LinuxRoute(val *linux_l3.LinuxStaticRoutes_Route) linux.DataResyncDSL
- func (dsl *MockDataResyncDSL) Send() defaultplugins.Reply
- func (dsl *MockDataResyncDSL) StaticRoute(val *l3.StaticRoutes_Route) linux.DataResyncDSL
- func (dsl *MockDataResyncDSL) VppInterface(val *vpp_intf.Interfaces_Interface) linux.DataResyncDSL
- func (dsl *MockDataResyncDSL) XConnect(val *l2.XConnectPairs_XConnectPair) linux.DataResyncDSL
- type MockDeleteDSL
- func (dsl *MockDeleteDSL) ACL(aclName string) linux.DeleteDSL
- func (dsl *MockDeleteDSL) BD(bdName string) linux.DeleteDSL
- func (dsl *MockDeleteDSL) BDFIB(bdName string, mac string) linux.DeleteDSL
- func (dsl *MockDeleteDSL) BfdAuthKeys(bfdKey uint32) linux.DeleteDSL
- func (dsl *MockDeleteDSL) BfdEchoFunction(bfdEchoName string) linux.DeleteDSL
- func (dsl *MockDeleteDSL) BfdSession(bfdSessionIfaceName string) linux.DeleteDSL
- func (dsl *MockDeleteDSL) LinuxArpEntry(val *linux_l3.LinuxStaticArpEntries_ArpEntry) linux.DeleteDSL
- func (dsl *MockDeleteDSL) LinuxInterface(ifName string) linux.DeleteDSL
- func (dsl *MockDeleteDSL) LinuxRoute(val *linux_l3.LinuxStaticRoutes_Route) linux.DeleteDSL
- func (dsl *MockDeleteDSL) Put() linux.PutDSL
- func (dsl *MockDeleteDSL) Send() defaultplugins.Reply
- func (dsl *MockDeleteDSL) StaticRoute(vrf uint32, dstAddrInput *net.IPNet, nextHopAddr net.IP) linux.DeleteDSL
- func (dsl *MockDeleteDSL) VppInterface(interfaceName string) linux.DeleteDSL
- func (dsl *MockDeleteDSL) XConnect(rxIfName string) linux.DeleteDSL
- type MockPutDSL
- func (dsl *MockPutDSL) ACL(val *acl.AccessLists_Acl) linux.PutDSL
- func (dsl *MockPutDSL) BD(val *l2.BridgeDomains_BridgeDomain) linux.PutDSL
- func (dsl *MockPutDSL) BDFIB(val *l2.FibTableEntries_FibTableEntry) linux.PutDSL
- func (dsl *MockPutDSL) BfdAuthKeys(val *bfd.SingleHopBFD_Key) linux.PutDSL
- func (dsl *MockPutDSL) BfdEchoFunction(val *bfd.SingleHopBFD_EchoFunction) linux.PutDSL
- func (dsl *MockPutDSL) BfdSession(val *bfd.SingleHopBFD_Session) linux.PutDSL
- func (dsl *MockPutDSL) Delete() linux.DeleteDSL
- func (dsl *MockPutDSL) LinuxArpEntry(val *linux_l3.LinuxStaticArpEntries_ArpEntry) linux.PutDSL
- func (dsl *MockPutDSL) LinuxInterface(val *linux_intf.LinuxInterfaces_Interface) linux.PutDSL
- func (dsl *MockPutDSL) LinuxRoute(val *linux_l3.LinuxStaticRoutes_Route) linux.PutDSL
- func (dsl *MockPutDSL) Send() defaultplugins.Reply
- func (dsl *MockPutDSL) StaticRoute(val *l3.StaticRoutes_Route) linux.PutDSL
- func (dsl *MockPutDSL) VppInterface(val *vpp_intf.Interfaces_Interface) linux.PutDSL
- func (dsl *MockPutDSL) XConnect(val *l2.XConnectPairs_XConnectPair) linux.PutDSL
- type Reply
- type Txn
- type TxnOp
- type TxnTracker
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 MockDataChangeDSL ¶
type MockDataChangeDSL struct { // List of transaction operations in the order as they were called. Ops []TxnOp // contains filtered or unexported fields }
MockDataChangeDSL is mock for DataChangeDSL.
func (*MockDataChangeDSL) Delete ¶
func (dsl *MockDataChangeDSL) Delete() linux.DeleteDSL
Delete initiates a chained sequence of data change DSL statements removing existing configurable objects.
func (*MockDataChangeDSL) Put ¶
func (dsl *MockDataChangeDSL) Put() linux.PutDSL
Put initiates a chained sequence of data change DSL statements declaring new or changing existing configurable objects.
func (*MockDataChangeDSL) Send ¶
func (dsl *MockDataChangeDSL) Send() defaultplugins.Reply
Send commits the transaction into the mock DB.
type MockDataResyncDSL ¶
type MockDataResyncDSL struct { // List of transaction operations in the order as they were called. Ops []TxnOp // contains filtered or unexported fields }
MockDataResyncDSL is mock for DataResyncDSL.
func (*MockDataResyncDSL) ACL ¶
func (dsl *MockDataResyncDSL) ACL(val *acl.AccessLists_Acl) linux.DataResyncDSL
ACL adds VPP Access Control List to the mock RESYNC request.
func (*MockDataResyncDSL) BD ¶
func (dsl *MockDataResyncDSL) BD(val *l2.BridgeDomains_BridgeDomain) linux.DataResyncDSL
BD adds VPP Bridge Domain to the mock RESYNC request.
func (*MockDataResyncDSL) BDFIB ¶
func (dsl *MockDataResyncDSL) BDFIB(val *l2.FibTableEntries_FibTableEntry) linux.DataResyncDSL
BDFIB adds VPP L2 FIB to the mock RESYNC request.
func (*MockDataResyncDSL) BfdAuthKeys ¶
func (dsl *MockDataResyncDSL) BfdAuthKeys(val *bfd.SingleHopBFD_Key) linux.DataResyncDSL
BfdAuthKeys adds VPP bidirectional forwarding detection key to the mock RESYNC request.
func (*MockDataResyncDSL) BfdEchoFunction ¶
func (dsl *MockDataResyncDSL) BfdEchoFunction(val *bfd.SingleHopBFD_EchoFunction) linux.DataResyncDSL
BfdEchoFunction adds VPP bidirectional forwarding detection echo function mock to the RESYNC request.
func (*MockDataResyncDSL) BfdSession ¶
func (dsl *MockDataResyncDSL) BfdSession(val *bfd.SingleHopBFD_Session) linux.DataResyncDSL
BfdSession adds VPP bidirectional forwarding detection session to the mock RESYNC request.
func (*MockDataResyncDSL) LinuxArpEntry ¶
func (dsl *MockDataResyncDSL) LinuxArpEntry(val *linux_l3.LinuxStaticArpEntries_ArpEntry) linux.DataResyncDSL
func (*MockDataResyncDSL) LinuxInterface ¶
func (dsl *MockDataResyncDSL) LinuxInterface(val *linux_intf.LinuxInterfaces_Interface) linux.DataResyncDSL
LinuxInterface adds Linux interface to the mock RESYNC request.
func (*MockDataResyncDSL) LinuxRoute ¶
func (dsl *MockDataResyncDSL) LinuxRoute(val *linux_l3.LinuxStaticRoutes_Route) linux.DataResyncDSL
func (*MockDataResyncDSL) Send ¶
func (dsl *MockDataResyncDSL) Send() defaultplugins.Reply
Send commits the transaction into the mock DB.
func (*MockDataResyncDSL) StaticRoute ¶
func (dsl *MockDataResyncDSL) StaticRoute(val *l3.StaticRoutes_Route) linux.DataResyncDSL
StaticRoute adds VPP L3 Static Route to the mock RESYNC request.
func (*MockDataResyncDSL) VppInterface ¶
func (dsl *MockDataResyncDSL) VppInterface(val *vpp_intf.Interfaces_Interface) linux.DataResyncDSL
VppInterface adds VPP interface to the mock RESYNC request.
func (*MockDataResyncDSL) XConnect ¶
func (dsl *MockDataResyncDSL) XConnect(val *l2.XConnectPairs_XConnectPair) linux.DataResyncDSL
XConnect adds VPP Cross Connect to the mock RESYNC request.
type MockDeleteDSL ¶
type MockDeleteDSL struct {
// contains filtered or unexported fields
}
MockDeleteDSL is a mock for DeleteDSL.
func (*MockDeleteDSL) ACL ¶
func (dsl *MockDeleteDSL) ACL(aclName string) linux.DeleteDSL
ACL adds a mock request to delete an existing VPP Access Control List.
func (*MockDeleteDSL) BD ¶
func (dsl *MockDeleteDSL) BD(bdName string) linux.DeleteDSL
BD adds a mock request to delete an existing VPP Bridge Domain.
func (*MockDeleteDSL) BDFIB ¶
func (dsl *MockDeleteDSL) BDFIB(bdName string, mac string) linux.DeleteDSL
BDFIB adds a mock request to delete an existing VPP L2 Forwarding Information Base.
func (*MockDeleteDSL) BfdAuthKeys ¶
func (dsl *MockDeleteDSL) BfdAuthKeys(bfdKey uint32) linux.DeleteDSL
BfdAuthKeys adds a mock request to delete an existing bidirectional forwarding detection key.
func (*MockDeleteDSL) BfdEchoFunction ¶
func (dsl *MockDeleteDSL) BfdEchoFunction(bfdEchoName string) linux.DeleteDSL
BfdEchoFunction adds a mock request to delete an existing bidirectional forwarding detection echo function.
func (*MockDeleteDSL) BfdSession ¶
func (dsl *MockDeleteDSL) BfdSession(bfdSessionIfaceName string) linux.DeleteDSL
BfdSession adds a mock request to delete an existing bidirectional forwarding detection session.
func (*MockDeleteDSL) LinuxArpEntry ¶
func (dsl *MockDeleteDSL) LinuxArpEntry(val *linux_l3.LinuxStaticArpEntries_ArpEntry) linux.DeleteDSL
func (*MockDeleteDSL) LinuxInterface ¶
func (dsl *MockDeleteDSL) LinuxInterface(ifName string) linux.DeleteDSL
LinuxInterface adds a mock request to delete an existing Linux network interface.
func (*MockDeleteDSL) LinuxRoute ¶
func (dsl *MockDeleteDSL) LinuxRoute(val *linux_l3.LinuxStaticRoutes_Route) linux.DeleteDSL
func (*MockDeleteDSL) Put ¶
func (dsl *MockDeleteDSL) Put() linux.PutDSL
Put changes the DSL mode to allow configuration editing.
func (*MockDeleteDSL) Send ¶
func (dsl *MockDeleteDSL) Send() defaultplugins.Reply
Send commits the transaction into the mock DB.
func (*MockDeleteDSL) StaticRoute ¶
func (dsl *MockDeleteDSL) StaticRoute(vrf uint32, dstAddrInput *net.IPNet, nextHopAddr net.IP) linux.DeleteDSL
StaticRoute adds a mock request to delete an existing VPP L3 Static Route..
func (*MockDeleteDSL) VppInterface ¶
func (dsl *MockDeleteDSL) VppInterface(interfaceName string) linux.DeleteDSL
Interface adds a mock request to delete an existing VPP network interface.
type MockPutDSL ¶
type MockPutDSL struct {
// contains filtered or unexported fields
}
MockPutDSL is a mock for PutDSL.
func (*MockPutDSL) ACL ¶
func (dsl *MockPutDSL) ACL(val *acl.AccessLists_Acl) linux.PutDSL
ACL adds a mock request to create or update VPP Access Control List.
func (*MockPutDSL) BD ¶
func (dsl *MockPutDSL) BD(val *l2.BridgeDomains_BridgeDomain) linux.PutDSL
BD adds a mock request to create or update VPP Bridge Domain.
func (*MockPutDSL) BDFIB ¶
func (dsl *MockPutDSL) BDFIB(val *l2.FibTableEntries_FibTableEntry) linux.PutDSL
BDFIB adds a mock request to create or update VPP L2 Forwarding Information Base.
func (*MockPutDSL) BfdAuthKeys ¶
func (dsl *MockPutDSL) BfdAuthKeys(val *bfd.SingleHopBFD_Key) linux.PutDSL
BfdAuthKeys adds a mock request to create or update bidirectional forwarding detection key.
func (*MockPutDSL) BfdEchoFunction ¶
func (dsl *MockPutDSL) BfdEchoFunction(val *bfd.SingleHopBFD_EchoFunction) linux.PutDSL
BfdEchoFunction adds a mock request to create or update bidirectional forwarding detection echo function.
func (*MockPutDSL) BfdSession ¶
func (dsl *MockPutDSL) BfdSession(val *bfd.SingleHopBFD_Session) linux.PutDSL
BfdSession adds a mock request to create or update bidirectional forwarding detection session.
func (*MockPutDSL) Delete ¶
func (dsl *MockPutDSL) Delete() linux.DeleteDSL
Delete changes the DSL mode to allow removal of an existing configuration.
func (*MockPutDSL) LinuxArpEntry ¶
func (dsl *MockPutDSL) LinuxArpEntry(val *linux_l3.LinuxStaticArpEntries_ArpEntry) linux.PutDSL
func (*MockPutDSL) LinuxInterface ¶
func (dsl *MockPutDSL) LinuxInterface(val *linux_intf.LinuxInterfaces_Interface) linux.PutDSL
LinuxInterface adds a mock request to create or update Linux network interface.
func (*MockPutDSL) LinuxRoute ¶
func (dsl *MockPutDSL) LinuxRoute(val *linux_l3.LinuxStaticRoutes_Route) linux.PutDSL
func (*MockPutDSL) Send ¶
func (dsl *MockPutDSL) Send() defaultplugins.Reply
Send commits the transaction into the mock DB.
func (*MockPutDSL) StaticRoute ¶
func (dsl *MockPutDSL) StaticRoute(val *l3.StaticRoutes_Route) linux.PutDSL
StaticRoute adds a mock request to create or update VPP L3 Static Route.
func (*MockPutDSL) VppInterface ¶
func (dsl *MockPutDSL) VppInterface(val *vpp_intf.Interfaces_Interface) linux.PutDSL
Interface adds a mock request to create or update VPP network interface.
func (*MockPutDSL) XConnect ¶
func (dsl *MockPutDSL) XConnect(val *l2.XConnectPairs_XConnectPair) linux.PutDSL
XConnect adds a mock request to create or update VPP Cross Connect.
type Reply ¶
type Reply struct {
// contains filtered or unexported fields
}
Reply interface allows to wait for a reply to previously called Send() and extract the result from it (success/error).
func (Reply) ReceiveReply ¶
ReceiveReply waits for a reply to previously called Send() and returns the result (error or nil).
type Txn ¶
type Txn struct { // DataResyncTxn is non-nil for RESYNC transaction. DataResyncTxn *MockDataResyncDSL // DataChangeTxn is non-nil for Data Change transaction. DataChangeTxn *MockDataChangeDSL }
Txn stores all information about a transaction. Exactly one of the fields is non-nil.
type TxnOp ¶
type TxnOp struct { // Key under which the value is stored or from which the value was removed. Key string // Value stored under the key or nil if it was deleted. Value proto.Message /* nil if deleted */ }
TxnOp stores all information about a transaction operation.
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) NewDataChangeTxn ¶
func (t *TxnTracker) NewDataChangeTxn() linux.DataChangeDSL
NewDataChangeTxn is a factory for DataChange transactions.
func (*TxnTracker) NewDataResyncTxn ¶
func (t *TxnTracker) NewDataResyncTxn() linux.DataResyncDSL
NewDataResyncTxn is a factory for RESYNC transactions.