controller

package
v2.1.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2019 License: Apache-2.0 Imports: 6 Imported by: 5 modules, 4 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommitFunc

type CommitFunc = func(values map[string]proto.Message) error

CommitFunc is function called from the mock to trigger transaction processing in TxnTracker.

type MockControllerTxn

type MockControllerTxn struct {
	Values controller.KeyValuePairs
	// contains filtered or unexported fields
}

MockControllerTxn is a mock implementation of the Transaction interface from Controller.

func NewMockControllerTxn

func NewMockControllerTxn(seqNum uint64, commitFunc CommitFunc) *MockControllerTxn

NewMockControllerTxn is a constructor for mock Controller Txn.

func (*MockControllerTxn) Commit

func (m *MockControllerTxn) Commit(ctx context.Context) (seqNum uint64, err error)

Commit applies the requested transaction changes.

func (*MockControllerTxn) Delete

func (m *MockControllerTxn) Delete(key string)

Delete adds request to the transaction to delete an existing value.

func (*MockControllerTxn) Get

func (m *MockControllerTxn) Get(key string) proto.Message

Get is used to obtain value already prepared to be applied by this transaction. Until the transaction is committed, provided values can still be changed.

func (*MockControllerTxn) Put

func (m *MockControllerTxn) Put(key string, value proto.Message)

Put add request to the transaction to add or modify a value. <value> cannot be nil.

Jump to

Keyboard shortcuts

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