ktable_mocks

package
v0.7.5 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Table

type Table struct {
	mock.Mock
}

Table is an autogenerated mock type for the Table type

func NewTable

func NewTable(t interface {
	mock.TestingT
	Cleanup(func())
}) *Table

NewTable creates a new instance of Table. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*Table) BatchCommand

func (_m *Table) BatchCommand(commands ...ktable.Command)

BatchCommand provides a mock function with given fields: commands

func (*Table) DropNode

func (_m *Table) DropNode(id protocol.ID, reason error) bool

DropNode provides a mock function with given fields: id, reason

func (*Table) EXPECT

func (_m *Table) EXPECT() *Table_Expecter

func (*Table) FilterKnownAddrs

func (_m *Table) FilterKnownAddrs(addrs []netip.Addr) []netip.Addr

FilterKnownAddrs provides a mock function with given fields: addrs

func (*Table) GetClosestNodes

func (_m *Table) GetClosestNodes(id protocol.ID) []ktable.Node

GetClosestNodes provides a mock function with given fields: id

func (*Table) GetHashOrClosestNodes

func (_m *Table) GetHashOrClosestNodes(id protocol.ID) ktable.GetHashOrClosestNodesResult

GetHashOrClosestNodes provides a mock function with given fields: id

func (*Table) GetNodesForSampleInfoHashes

func (_m *Table) GetNodesForSampleInfoHashes(n int) []ktable.Node

GetNodesForSampleInfoHashes provides a mock function with given fields: n

func (*Table) GetOldestNodes

func (_m *Table) GetOldestNodes(cutoff time.Time, n int) []ktable.Node

GetOldestNodes provides a mock function with given fields: cutoff, n

func (*Table) Origin

func (_m *Table) Origin() protocol.ID

Origin provides a mock function with given fields:

func (*Table) PutHash

func (_m *Table) PutHash(id protocol.ID, peers []ktable.HashPeer, options ...ktable.HashOption) btree.PutResult

PutHash provides a mock function with given fields: id, peers, options

func (*Table) PutNode

func (_m *Table) PutNode(id protocol.ID, addr netip.AddrPort, options ...ktable.NodeOption) btree.PutResult

PutNode provides a mock function with given fields: id, addr, options

func (*Table) SampleHashesAndNodes

func (_m *Table) SampleHashesAndNodes() ktable.SampleHashesAndNodesResult

SampleHashesAndNodes provides a mock function with given fields:

type Table_BatchCommand_Call

type Table_BatchCommand_Call struct {
	*mock.Call
}

Table_BatchCommand_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BatchCommand'

func (*Table_BatchCommand_Call) Return

func (*Table_BatchCommand_Call) Run

func (_c *Table_BatchCommand_Call) Run(run func(commands ...ktable.Command)) *Table_BatchCommand_Call

func (*Table_BatchCommand_Call) RunAndReturn

func (_c *Table_BatchCommand_Call) RunAndReturn(run func(...ktable.Command)) *Table_BatchCommand_Call

type Table_DropNode_Call

type Table_DropNode_Call struct {
	*mock.Call
}

Table_DropNode_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DropNode'

func (*Table_DropNode_Call) Return

func (_c *Table_DropNode_Call) Return(_a0 bool) *Table_DropNode_Call

func (*Table_DropNode_Call) Run

func (_c *Table_DropNode_Call) Run(run func(id protocol.ID, reason error)) *Table_DropNode_Call

func (*Table_DropNode_Call) RunAndReturn

func (_c *Table_DropNode_Call) RunAndReturn(run func(protocol.ID, error) bool) *Table_DropNode_Call

type Table_Expecter

type Table_Expecter struct {
	// contains filtered or unexported fields
}

func (*Table_Expecter) BatchCommand

func (_e *Table_Expecter) BatchCommand(commands ...interface{}) *Table_BatchCommand_Call

BatchCommand is a helper method to define mock.On call

  • commands ...ktable.Command

func (*Table_Expecter) DropNode

func (_e *Table_Expecter) DropNode(id interface{}, reason interface{}) *Table_DropNode_Call

DropNode is a helper method to define mock.On call

  • id protocol.ID
  • reason error

func (*Table_Expecter) FilterKnownAddrs

func (_e *Table_Expecter) FilterKnownAddrs(addrs interface{}) *Table_FilterKnownAddrs_Call

FilterKnownAddrs is a helper method to define mock.On call

  • addrs []netip.Addr

func (*Table_Expecter) GetClosestNodes

func (_e *Table_Expecter) GetClosestNodes(id interface{}) *Table_GetClosestNodes_Call

GetClosestNodes is a helper method to define mock.On call

  • id protocol.ID

func (*Table_Expecter) GetHashOrClosestNodes

func (_e *Table_Expecter) GetHashOrClosestNodes(id interface{}) *Table_GetHashOrClosestNodes_Call

GetHashOrClosestNodes is a helper method to define mock.On call

  • id protocol.ID

func (*Table_Expecter) GetNodesForSampleInfoHashes

func (_e *Table_Expecter) GetNodesForSampleInfoHashes(n interface{}) *Table_GetNodesForSampleInfoHashes_Call

GetNodesForSampleInfoHashes is a helper method to define mock.On call

  • n int

func (*Table_Expecter) GetOldestNodes

func (_e *Table_Expecter) GetOldestNodes(cutoff interface{}, n interface{}) *Table_GetOldestNodes_Call

GetOldestNodes is a helper method to define mock.On call

  • cutoff time.Time
  • n int

func (*Table_Expecter) Origin

func (_e *Table_Expecter) Origin() *Table_Origin_Call

Origin is a helper method to define mock.On call

func (*Table_Expecter) PutHash

func (_e *Table_Expecter) PutHash(id interface{}, peers interface{}, options ...interface{}) *Table_PutHash_Call

PutHash is a helper method to define mock.On call

  • id protocol.ID
  • peers []ktable.HashPeer
  • options ...ktable.HashOption

func (*Table_Expecter) PutNode

func (_e *Table_Expecter) PutNode(id interface{}, addr interface{}, options ...interface{}) *Table_PutNode_Call

PutNode is a helper method to define mock.On call

  • id protocol.ID
  • addr netip.AddrPort
  • options ...ktable.NodeOption

func (*Table_Expecter) SampleHashesAndNodes

func (_e *Table_Expecter) SampleHashesAndNodes() *Table_SampleHashesAndNodes_Call

SampleHashesAndNodes is a helper method to define mock.On call

type Table_FilterKnownAddrs_Call

type Table_FilterKnownAddrs_Call struct {
	*mock.Call
}

Table_FilterKnownAddrs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterKnownAddrs'

func (*Table_FilterKnownAddrs_Call) Return

func (*Table_FilterKnownAddrs_Call) Run

func (*Table_FilterKnownAddrs_Call) RunAndReturn

type Table_GetClosestNodes_Call

type Table_GetClosestNodes_Call struct {
	*mock.Call
}

Table_GetClosestNodes_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetClosestNodes'

func (*Table_GetClosestNodes_Call) Return

func (*Table_GetClosestNodes_Call) Run

func (*Table_GetClosestNodes_Call) RunAndReturn

type Table_GetHashOrClosestNodes_Call

type Table_GetHashOrClosestNodes_Call struct {
	*mock.Call
}

Table_GetHashOrClosestNodes_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetHashOrClosestNodes'

func (*Table_GetHashOrClosestNodes_Call) Return

func (*Table_GetHashOrClosestNodes_Call) Run

func (*Table_GetHashOrClosestNodes_Call) RunAndReturn

type Table_GetNodesForSampleInfoHashes_Call

type Table_GetNodesForSampleInfoHashes_Call struct {
	*mock.Call
}

Table_GetNodesForSampleInfoHashes_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetNodesForSampleInfoHashes'

func (*Table_GetNodesForSampleInfoHashes_Call) Return

func (*Table_GetNodesForSampleInfoHashes_Call) Run

func (*Table_GetNodesForSampleInfoHashes_Call) RunAndReturn

type Table_GetOldestNodes_Call

type Table_GetOldestNodes_Call struct {
	*mock.Call
}

Table_GetOldestNodes_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetOldestNodes'

func (*Table_GetOldestNodes_Call) Return

func (*Table_GetOldestNodes_Call) Run

func (_c *Table_GetOldestNodes_Call) Run(run func(cutoff time.Time, n int)) *Table_GetOldestNodes_Call

func (*Table_GetOldestNodes_Call) RunAndReturn

type Table_Origin_Call

type Table_Origin_Call struct {
	*mock.Call
}

Table_Origin_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Origin'

func (*Table_Origin_Call) Return

func (*Table_Origin_Call) Run

func (_c *Table_Origin_Call) Run(run func()) *Table_Origin_Call

func (*Table_Origin_Call) RunAndReturn

func (_c *Table_Origin_Call) RunAndReturn(run func() protocol.ID) *Table_Origin_Call

type Table_PutHash_Call

type Table_PutHash_Call struct {
	*mock.Call
}

Table_PutHash_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PutHash'

func (*Table_PutHash_Call) Return

func (*Table_PutHash_Call) Run

func (_c *Table_PutHash_Call) Run(run func(id protocol.ID, peers []ktable.HashPeer, options ...ktable.HashOption)) *Table_PutHash_Call

func (*Table_PutHash_Call) RunAndReturn

type Table_PutNode_Call

type Table_PutNode_Call struct {
	*mock.Call
}

Table_PutNode_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PutNode'

func (*Table_PutNode_Call) Return

func (*Table_PutNode_Call) Run

func (_c *Table_PutNode_Call) Run(run func(id protocol.ID, addr netip.AddrPort, options ...ktable.NodeOption)) *Table_PutNode_Call

func (*Table_PutNode_Call) RunAndReturn

type Table_SampleHashesAndNodes_Call

type Table_SampleHashesAndNodes_Call struct {
	*mock.Call
}

Table_SampleHashesAndNodes_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SampleHashesAndNodes'

func (*Table_SampleHashesAndNodes_Call) Return

func (*Table_SampleHashesAndNodes_Call) Run

func (*Table_SampleHashesAndNodes_Call) RunAndReturn

Jump to

Keyboard shortcuts

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