localclient

package
v0.0.0-...-a11b7ec Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package localclient contains mocks for transactions created by DSL structures in localclient packages.

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 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
dsl
Package dsl is base package for mocks of DSL transaction creators.
Package dsl is base package for mocks of DSL transaction creators.

Jump to

Keyboard shortcuts

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