Documentation ¶
Index ¶
- type Table
- func (_m *Table) BatchCommand(commands ...ktable.Command)
- func (_m *Table) DropNode(id protocol.ID, reason error) bool
- func (_m *Table) EXPECT() *Table_Expecter
- func (_m *Table) FilterKnownAddrs(addrs []netip.Addr) []netip.Addr
- func (_m *Table) GetClosestNodes(id protocol.ID) []ktable.Node
- func (_m *Table) GetHashOrClosestNodes(id protocol.ID) ktable.GetHashOrClosestNodesResult
- func (_m *Table) GetNodesForSampleInfoHashes(n int) []ktable.Node
- func (_m *Table) GetOldestNodes(cutoff time.Time, n int) []ktable.Node
- func (_m *Table) Origin() protocol.ID
- func (_m *Table) PutHash(id protocol.ID, peers []ktable.HashPeer, options ...ktable.HashOption) btree.PutResult
- func (_m *Table) PutNode(id protocol.ID, addr netip.AddrPort, options ...ktable.NodeOption) btree.PutResult
- func (_m *Table) SampleHashesAndNodes() ktable.SampleHashesAndNodesResult
- type Table_BatchCommand_Call
- type Table_DropNode_Call
- type Table_Expecter
- func (_e *Table_Expecter) BatchCommand(commands ...interface{}) *Table_BatchCommand_Call
- func (_e *Table_Expecter) DropNode(id interface{}, reason interface{}) *Table_DropNode_Call
- func (_e *Table_Expecter) FilterKnownAddrs(addrs interface{}) *Table_FilterKnownAddrs_Call
- func (_e *Table_Expecter) GetClosestNodes(id interface{}) *Table_GetClosestNodes_Call
- func (_e *Table_Expecter) GetHashOrClosestNodes(id interface{}) *Table_GetHashOrClosestNodes_Call
- func (_e *Table_Expecter) GetNodesForSampleInfoHashes(n interface{}) *Table_GetNodesForSampleInfoHashes_Call
- func (_e *Table_Expecter) GetOldestNodes(cutoff interface{}, n interface{}) *Table_GetOldestNodes_Call
- func (_e *Table_Expecter) Origin() *Table_Origin_Call
- func (_e *Table_Expecter) PutHash(id interface{}, peers interface{}, options ...interface{}) *Table_PutHash_Call
- func (_e *Table_Expecter) PutNode(id interface{}, addr interface{}, options ...interface{}) *Table_PutNode_Call
- func (_e *Table_Expecter) SampleHashesAndNodes() *Table_SampleHashesAndNodes_Call
- type Table_FilterKnownAddrs_Call
- func (_c *Table_FilterKnownAddrs_Call) Return(_a0 []netip.Addr) *Table_FilterKnownAddrs_Call
- func (_c *Table_FilterKnownAddrs_Call) Run(run func(addrs []netip.Addr)) *Table_FilterKnownAddrs_Call
- func (_c *Table_FilterKnownAddrs_Call) RunAndReturn(run func([]netip.Addr) []netip.Addr) *Table_FilterKnownAddrs_Call
- type Table_GetClosestNodes_Call
- func (_c *Table_GetClosestNodes_Call) Return(_a0 []ktable.Node) *Table_GetClosestNodes_Call
- func (_c *Table_GetClosestNodes_Call) Run(run func(id protocol.ID)) *Table_GetClosestNodes_Call
- func (_c *Table_GetClosestNodes_Call) RunAndReturn(run func(protocol.ID) []ktable.Node) *Table_GetClosestNodes_Call
- type Table_GetHashOrClosestNodes_Call
- func (_c *Table_GetHashOrClosestNodes_Call) Return(_a0 ktable.GetHashOrClosestNodesResult) *Table_GetHashOrClosestNodes_Call
- func (_c *Table_GetHashOrClosestNodes_Call) Run(run func(id protocol.ID)) *Table_GetHashOrClosestNodes_Call
- func (_c *Table_GetHashOrClosestNodes_Call) RunAndReturn(run func(protocol.ID) ktable.GetHashOrClosestNodesResult) *Table_GetHashOrClosestNodes_Call
- type Table_GetNodesForSampleInfoHashes_Call
- func (_c *Table_GetNodesForSampleInfoHashes_Call) Return(_a0 []ktable.Node) *Table_GetNodesForSampleInfoHashes_Call
- func (_c *Table_GetNodesForSampleInfoHashes_Call) Run(run func(n int)) *Table_GetNodesForSampleInfoHashes_Call
- func (_c *Table_GetNodesForSampleInfoHashes_Call) RunAndReturn(run func(int) []ktable.Node) *Table_GetNodesForSampleInfoHashes_Call
- type Table_GetOldestNodes_Call
- func (_c *Table_GetOldestNodes_Call) Return(_a0 []ktable.Node) *Table_GetOldestNodes_Call
- func (_c *Table_GetOldestNodes_Call) Run(run func(cutoff time.Time, n int)) *Table_GetOldestNodes_Call
- func (_c *Table_GetOldestNodes_Call) RunAndReturn(run func(time.Time, int) []ktable.Node) *Table_GetOldestNodes_Call
- type Table_Origin_Call
- type Table_PutHash_Call
- type Table_PutNode_Call
- func (_c *Table_PutNode_Call) Return(_a0 btree.PutResult) *Table_PutNode_Call
- func (_c *Table_PutNode_Call) Run(run func(id protocol.ID, addr netip.AddrPort, options ...ktable.NodeOption)) *Table_PutNode_Call
- func (_c *Table_PutNode_Call) RunAndReturn(run func(protocol.ID, netip.AddrPort, ...ktable.NodeOption) btree.PutResult) *Table_PutNode_Call
- type Table_SampleHashesAndNodes_Call
- func (_c *Table_SampleHashesAndNodes_Call) Return(_a0 ktable.SampleHashesAndNodesResult) *Table_SampleHashesAndNodes_Call
- func (_c *Table_SampleHashesAndNodes_Call) Run(run func()) *Table_SampleHashesAndNodes_Call
- func (_c *Table_SampleHashesAndNodes_Call) RunAndReturn(run func() ktable.SampleHashesAndNodesResult) *Table_SampleHashesAndNodes_Call
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Table ¶
Table is an autogenerated mock type for the Table type
func NewTable ¶
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 ¶
BatchCommand provides a mock function with given fields: commands
func (*Table) EXPECT ¶
func (_m *Table) EXPECT() *Table_Expecter
func (*Table) FilterKnownAddrs ¶
FilterKnownAddrs provides a mock function with given fields: addrs
func (*Table) GetClosestNodes ¶
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 ¶
GetNodesForSampleInfoHashes provides a mock function with given fields: n
func (*Table) GetOldestNodes ¶
GetOldestNodes provides a mock function with given fields: cutoff, n
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 ¶
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 (_c *Table_BatchCommand_Call) Return() *Table_BatchCommand_Call
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 ¶
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 ¶
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 (_c *Table_FilterKnownAddrs_Call) Return(_a0 []netip.Addr) *Table_FilterKnownAddrs_Call
func (*Table_FilterKnownAddrs_Call) Run ¶
func (_c *Table_FilterKnownAddrs_Call) Run(run func(addrs []netip.Addr)) *Table_FilterKnownAddrs_Call
func (*Table_FilterKnownAddrs_Call) RunAndReturn ¶
func (_c *Table_FilterKnownAddrs_Call) RunAndReturn(run func([]netip.Addr) []netip.Addr) *Table_FilterKnownAddrs_Call
type Table_GetClosestNodes_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 (_c *Table_GetClosestNodes_Call) Return(_a0 []ktable.Node) *Table_GetClosestNodes_Call
func (*Table_GetClosestNodes_Call) Run ¶
func (_c *Table_GetClosestNodes_Call) Run(run func(id protocol.ID)) *Table_GetClosestNodes_Call
func (*Table_GetClosestNodes_Call) RunAndReturn ¶
func (_c *Table_GetClosestNodes_Call) RunAndReturn(run func(protocol.ID) []ktable.Node) *Table_GetClosestNodes_Call
type Table_GetHashOrClosestNodes_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 (_c *Table_GetHashOrClosestNodes_Call) Return(_a0 ktable.GetHashOrClosestNodesResult) *Table_GetHashOrClosestNodes_Call
func (*Table_GetHashOrClosestNodes_Call) Run ¶
func (_c *Table_GetHashOrClosestNodes_Call) Run(run func(id protocol.ID)) *Table_GetHashOrClosestNodes_Call
func (*Table_GetHashOrClosestNodes_Call) RunAndReturn ¶
func (_c *Table_GetHashOrClosestNodes_Call) RunAndReturn(run func(protocol.ID) ktable.GetHashOrClosestNodesResult) *Table_GetHashOrClosestNodes_Call
type Table_GetNodesForSampleInfoHashes_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 (_c *Table_GetNodesForSampleInfoHashes_Call) Return(_a0 []ktable.Node) *Table_GetNodesForSampleInfoHashes_Call
func (*Table_GetNodesForSampleInfoHashes_Call) Run ¶
func (_c *Table_GetNodesForSampleInfoHashes_Call) Run(run func(n int)) *Table_GetNodesForSampleInfoHashes_Call
func (*Table_GetNodesForSampleInfoHashes_Call) RunAndReturn ¶
func (_c *Table_GetNodesForSampleInfoHashes_Call) RunAndReturn(run func(int) []ktable.Node) *Table_GetNodesForSampleInfoHashes_Call
type Table_GetOldestNodes_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 (_c *Table_GetOldestNodes_Call) Return(_a0 []ktable.Node) *Table_GetOldestNodes_Call
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 ¶
func (_c *Table_GetOldestNodes_Call) RunAndReturn(run func(time.Time, int) []ktable.Node) *Table_GetOldestNodes_Call
type Table_Origin_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 (_c *Table_Origin_Call) Return(_a0 protocol.ID) *Table_Origin_Call
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 ¶
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 (_c *Table_PutHash_Call) Return(_a0 btree.PutResult) *Table_PutHash_Call
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 ¶
func (_c *Table_PutHash_Call) RunAndReturn(run func(protocol.ID, []ktable.HashPeer, ...ktable.HashOption) btree.PutResult) *Table_PutHash_Call
type Table_PutNode_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 (_c *Table_PutNode_Call) Return(_a0 btree.PutResult) *Table_PutNode_Call
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 ¶
func (_c *Table_PutNode_Call) RunAndReturn(run func(protocol.ID, netip.AddrPort, ...ktable.NodeOption) btree.PutResult) *Table_PutNode_Call
type Table_SampleHashesAndNodes_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 (_c *Table_SampleHashesAndNodes_Call) Return(_a0 ktable.SampleHashesAndNodesResult) *Table_SampleHashesAndNodes_Call
func (*Table_SampleHashesAndNodes_Call) Run ¶
func (_c *Table_SampleHashesAndNodes_Call) Run(run func()) *Table_SampleHashesAndNodes_Call
func (*Table_SampleHashesAndNodes_Call) RunAndReturn ¶
func (_c *Table_SampleHashesAndNodes_Call) RunAndReturn(run func() ktable.SampleHashesAndNodesResult) *Table_SampleHashesAndNodes_Call