Documentation ¶
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 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 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) }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.