Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Btree ¶
type Btree interface { N() int Put(NodeID) PutResult Has(NodeID) bool Drop(NodeID) bool Closest(NodeID, int) []NodeID Count() int }
Btree is the binary tree implementation used by the Kademlia routing table. The Kademlia literature refers to "buckets" that can be "split" according to certain rules when they are full. This implementation does not use buckets exactly as described in the literature, but rather a simpler binary tree, however the end result is largely equivalent.
type NodeID ¶
type NodeID []byte
func MustParseBinaryNodeID ¶
func ParseBinaryNodeID ¶
func (NodeID) BinaryString ¶
type PrometheusCollector ¶ added in v0.2.0
type PrometheusCollector struct { Btree Btree CountGauge prometheus.Gauge AddedCounter prometheus.Counter DroppedCounter prometheus.Counter }
func (PrometheusCollector) Closest ¶ added in v0.2.0
func (p PrometheusCollector) Closest(id NodeID, count int) []NodeID
func (PrometheusCollector) Count ¶ added in v0.2.0
func (p PrometheusCollector) Count() int
func (PrometheusCollector) Drop ¶ added in v0.2.0
func (p PrometheusCollector) Drop(id NodeID) bool
func (PrometheusCollector) Has ¶ added in v0.2.0
func (p PrometheusCollector) Has(id NodeID) bool
func (PrometheusCollector) N ¶ added in v0.2.0
func (p PrometheusCollector) N() int
func (PrometheusCollector) Put ¶ added in v0.2.0
func (p PrometheusCollector) Put(id NodeID) PutResult
Click to show internal directories.
Click to hide internal directories.