Documentation ¶
Index ¶
- type SimpleRT
- func (rt *SimpleRT[K, N]) AddNode(id N) bool
- func (rt *SimpleRT[K, N]) BucketIdForKey(kadId K) (int, error)
- func (rt *SimpleRT[K, N]) BucketSize() int
- func (rt *SimpleRT[K, N]) Cpl(kk K) int
- func (rt *SimpleRT[K, N]) CplSize(cpl int) int
- func (rt *SimpleRT[K, N]) GetNode(kadId K) (N, bool)
- func (rt *SimpleRT[K, N]) KeySize() int
- func (rt *SimpleRT[K, N]) NearestNodes(kadId K, n int) []N
- func (rt *SimpleRT[K, N]) RemoveKey(kadId K) bool
- func (rt *SimpleRT[K, N]) Self() K
- func (rt *SimpleRT[K, N]) SizeOfBucket(bucketId int) int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SimpleRT ¶
func (*SimpleRT[K, N]) BucketIdForKey ¶
func (*SimpleRT[K, N]) BucketSize ¶
func (*SimpleRT[K, N]) Cpl ¶
Cpl returns the longest common prefix length the supplied key shares with the table's key.
func (*SimpleRT[K, N]) CplSize ¶
CplSize returns the number of nodes in the table whose longest common prefix with the table's key is of length cpl.
func (*SimpleRT[K, N]) NearestNodes ¶
TODO: not exactly working as expected returns min(n, bucketSize) peers from the bucket matching the given key
func (*SimpleRT[K, N]) SizeOfBucket ¶
Click to show internal directories.
Click to hide internal directories.