Documentation ¶
Overview ¶
Package discovery is a generated GoMock package.
Index ¶
- type Discovery
- func (d *Discovery) Delete(id vnode.NodeID, reason error)
- func (d *Discovery) GetNodes(count int) (nodes []*vnode.Node)
- func (d *Discovery) Nodes() []*vnode.Node
- func (d *Discovery) NodesCount() int
- func (d *Discovery) SetFinder(f Finder)
- func (d *Discovery) Start() (err error)
- func (d *Discovery) Stop() (err error)
- func (d *Discovery) SubscribeNode(receiver func(n *vnode.Node)) (subId int)
- func (d *Discovery) Unsubscribe(subId int)
- type Finder
- type Mockreceiver
- type MockreceiverMockRecorder
- type Mocksender
- type MocksenderMockRecorder
- type Mocksocket
- type MocksocketMockRecorder
- type Node
- type NodeDB
- type Observer
- type Request
- type Result
- type Subscriber
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Discovery ¶
type Discovery struct {
// contains filtered or unexported fields
}
func New ¶
func New(peerKey ed25519.PrivateKey, node *vnode.Node, bootNodes, bootSeeds []string, listenAddress string, db NodeDB) *Discovery
New create a Discovery implementation
func (*Discovery) NodesCount ¶
func (*Discovery) SubscribeNode ¶
func (*Discovery) Unsubscribe ¶
type Mockreceiver ¶ added in v2.11.3
type Mockreceiver struct {
// contains filtered or unexported fields
}
Mockreceiver is a mock of receiver interface.
func NewMockreceiver ¶ added in v2.11.3
func NewMockreceiver(ctrl *gomock.Controller) *Mockreceiver
NewMockreceiver creates a new mock instance.
func (*Mockreceiver) EXPECT ¶ added in v2.11.3
func (m *Mockreceiver) EXPECT() *MockreceiverMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockreceiverMockRecorder ¶ added in v2.11.3
type MockreceiverMockRecorder struct {
// contains filtered or unexported fields
}
MockreceiverMockRecorder is the mock recorder for Mockreceiver.
type Mocksender ¶ added in v2.11.3
type Mocksender struct {
// contains filtered or unexported fields
}
Mocksender is a mock of sender interface.
func NewMocksender ¶ added in v2.11.3
func NewMocksender(ctrl *gomock.Controller) *Mocksender
NewMocksender creates a new mock instance.
func (*Mocksender) EXPECT ¶ added in v2.11.3
func (m *Mocksender) EXPECT() *MocksenderMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MocksenderMockRecorder ¶ added in v2.11.3
type MocksenderMockRecorder struct {
// contains filtered or unexported fields
}
MocksenderMockRecorder is the mock recorder for Mocksender.
type Mocksocket ¶ added in v2.11.3
type Mocksocket struct {
// contains filtered or unexported fields
}
Mocksocket is a mock of socket interface.
func NewMocksocket ¶ added in v2.11.3
func NewMocksocket(ctrl *gomock.Controller) *Mocksocket
NewMocksocket creates a new mock instance.
func (*Mocksocket) EXPECT ¶ added in v2.11.3
func (m *Mocksocket) EXPECT() *MocksocketMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MocksocketMockRecorder ¶ added in v2.11.3
type MocksocketMockRecorder struct {
// contains filtered or unexported fields
}
MocksocketMockRecorder is the mock recorder for Mocksocket.
type NodeDB ¶
type NodeDB interface { StoreNode(node *vnode.Node) (err error) RemoveNode(id vnode.NodeID) ReadNodes(expiration int64) []*vnode.Node RetrieveActiveAt(id vnode.NodeID) int64 StoreActiveAt(id vnode.NodeID, v int64) RetrieveCheckAt(id vnode.NodeID) int64 StoreCheckAt(id vnode.NodeID, v int64) Close() error Clean(expiration int64) }
type Observer ¶
type Observer interface { Sub(sub Subscriber) UnSub(sub Subscriber) }