localclient

package
v0.0.0-...-792cabc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 10, 2017 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigSnapshot

type ConfigSnapshot map[string]proto.Message

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

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

ACL adds VPP Access Control List to the mock RESYNC request.

func (*MockDataResyncDSL) BD

BD adds VPP Bridge Domain to the mock RESYNC request.

func (*MockDataResyncDSL) BDFIB

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

BfdEchoFunction adds VPP bidirectional forwarding detection echo function mock to the RESYNC request.

func (*MockDataResyncDSL) BfdSession

BfdSession adds VPP bidirectional forwarding detection session to the mock RESYNC request.

func (*MockDataResyncDSL) LinuxArpEntry

func (*MockDataResyncDSL) LinuxInterface

LinuxInterface adds Linux interface to the mock RESYNC request.

func (*MockDataResyncDSL) LinuxRoute

func (*MockDataResyncDSL) Send

Send commits the transaction into the mock DB.

func (*MockDataResyncDSL) StaticRoute

StaticRoute adds VPP L3 Static Route to the mock RESYNC request.

func (*MockDataResyncDSL) VppInterface

VppInterface adds VPP interface to the mock RESYNC request.

func (*MockDataResyncDSL) XConnect

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 (*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 (*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.

func (*MockDeleteDSL) XConnect

func (dsl *MockDeleteDSL) XConnect(rxIfName string) linux.DeleteDSL

XConnect adds a mock request to delete an existing VPP Cross Connect.

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

BD adds a mock request to create or update VPP Bridge Domain.

func (*MockPutDSL) BDFIB

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 (*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

func (dsl Reply) ReceiveReply() error

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL