Documentation ¶
Index ¶
- Constants
- func AddrConvUDP(str string) (net.Addr, error)
- func HammingDistance(id1, id2 []byte) int
- func IdDecode(id string) ([]byte, error)
- func IdEncode(id []byte) string
- type AddrConv
- type Agent
- func (a *Agent) Call(dest net.Addr)
- func (a *Agent) IAm(dest net.Addr, id string)
- func (a *Agent) IHave(dest net.Addr, id string)
- func (a *Agent) Ping(dest net.Addr, id string)
- func (a *Agent) Pong(dest net.Addr, id string)
- func (a *Agent) Propagate(dest net.Addr, id string, addr net.Addr)
- func (a *Agent) Reader()
- func (a *Agent) Recall(dest net.Addr, passive net.Addr)
- func (a *Agent) Request(dest net.Addr, ttl int64, id string, addr net.Addr)
- type AgentThread
- type Cmd
- type CmdRequest
- type Nlist
- type Node
- type NodeMap
Constants ¶
View Source
const ( Propagate = iota Request IAm IHave Call Recall Ping Pong )
Variables ¶
This section is empty.
Functions ¶
func HammingDistance ¶
Calculates the hamming distance between 2 hashes
Types ¶
type Agent ¶
type Agent struct { Socket net.PacketConn Open bool ReaderCh chan Cmd // contains filtered or unexported fields }
type AgentThread ¶
type AgentThread struct { OwnNodeID []byte MainList Nlist NearList Nlist Agent Agent AddrConv AddrConv Bucket bucket.Bucket MaxTTL int64 // contains filtered or unexported fields }
func (*AgentThread) Constructor ¶
func (at *AgentThread) Constructor()
func (*AgentThread) Start ¶
func (at *AgentThread) Start()
Click to show internal directories.
Click to hide internal directories.