Documentation ¶
Index ¶
- func HammingDistance(id1, id2 []byte) int
- func HammingDistanceRH(id1 []byte, id2s string) (int, error)
- func JsonGetField(json interface{}, field string) (interface{}, bool)
- func JsonGetFieldString(json interface{}, field string) (string, bool)
- type Contact
- type ContactTable
- func (c *ContactTable) Debug()
- func (c *ContactTable) GetCloser(ids string, od int) <-chan net.Addr
- func (c *ContactTable) GetClosest(id []byte) (Contact, int, bool)
- func (c *ContactTable) Insert(con Contact)
- func (c *ContactTable) Len() int
- func (c *ContactTable) Less(i, j int) bool
- func (c *ContactTable) Limit(n int)
- func (c *ContactTable) SLimit(n int)
- func (c *ContactTable) SearchId(id string) (bool, int)
- func (c *ContactTable) Sort()
- func (c *ContactTable) Swap(i, j int)
- type IHaveMsg
- type Node
- type Packet
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HammingDistance ¶
Calculates the hamming distance between 2 hashes
func JsonGetField ¶
func JsonGetFieldString ¶
Types ¶
type ContactTable ¶
type ContactTable struct { Data []Contact // contains filtered or unexported fields }
func (*ContactTable) Debug ¶
func (c *ContactTable) Debug()
func (*ContactTable) GetCloser ¶
func (c *ContactTable) GetCloser(ids string, od int) <-chan net.Addr
func (*ContactTable) GetClosest ¶
func (c *ContactTable) GetClosest(id []byte) (Contact, int, bool)
func (*ContactTable) Insert ¶
func (c *ContactTable) Insert(con Contact)
func (*ContactTable) Len ¶
func (c *ContactTable) Len() int
func (*ContactTable) Less ¶
func (c *ContactTable) Less(i, j int) bool
func (*ContactTable) Limit ¶
func (c *ContactTable) Limit(n int)
func (*ContactTable) SLimit ¶
func (c *ContactTable) SLimit(n int)
func (*ContactTable) Sort ¶
func (c *ContactTable) Sort()
func (*ContactTable) Swap ¶
func (c *ContactTable) Swap(i, j int)
type Node ¶
type Node struct { Conn net.PacketConn Id []byte IdEnc string Table *ContactTable IHCh chan *IHaveMsg Bucket bucket.Bucket BucketServicePort string Debug bool }
func CreateNode ¶
func CreateNode(conn net.PacketConn, id []byte) *Node
func (*Node) BroadSearch ¶
Click to show internal directories.
Click to hide internal directories.