tests

package
v0.0.0-...-17369de Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewKVTest

func NewKVTest(groupID uint64, nodeID uint64) statemachine.IStateMachine

NewKVTest creates and return a new KVTest object.

Types

type KVTest

type KVTest struct {
	GroupID uint64            `json:"-"`
	NodeID  uint64            `json:"-"`
	KVStore map[string]string `json:"KVStore"`
	Count   uint64            `json:"Count"`
	Junk    []byte            `json:"Junk"`
	// contains filtered or unexported fields
}

KVTest is a in memory key-value store struct used for testing purposes. Note that both key/value are suppose to be valid utf-8 strings.

func (*KVTest) Close

func (s *KVTest) Close()

Close closes the IStateMachine instance

func (*KVTest) GetHash

func (s *KVTest) GetHash() uint64

GetHash returns a uint64 representing the current object state.

func (*KVTest) Lookup

func (s *KVTest) Lookup(key []byte) []byte

Lookup performances local looks up for the sepcified data.

func (*KVTest) Update

func (s *KVTest) Update(data []byte) uint64

Update updates the object using the specified committed raft entry.

type NoOP

type NoOP struct {
}

NoOP is a IStateMachine struct used for testing purpose.

func (*NoOP) Close

func (n *NoOP) Close()

Close closes the NoOP IStateMachine.

func (*NoOP) GetHash

func (n *NoOP) GetHash() uint64

GetHash returns a uint64 value representing the current state of the object.

func (*NoOP) Lookup

func (n *NoOP) Lookup(key []byte) []byte

Lookup locally looks up the data.

func (*NoOP) Update

func (n *NoOP) Update(data []byte) uint64

Update updates the object.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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