Documentation ¶
Index ¶
Constants ¶
View Source
const BucketSize = 20
View Source
const IdLength = 20
Variables ¶
This section is empty.
Functions ¶
func Equal ¶
func Equal(x interface{}, table *RoutingTable) bool
Types ¶
type ContractRecord ¶
type ContractRecord struct {
// contains filtered or unexported fields
}
func (*ContractRecord) Less ¶
func (rec *ContractRecord) Less(other interface{}) bool
type FindNodeRequest ¶
type FindNodeRequest struct { RPCHeader // contains filtered or unexported fields }
type FindNodeResponse ¶
type FindNodeResponse struct { RPCHeader // contains filtered or unexported fields }
type Kademlia ¶
type Kademlia struct { NetworkId string // contains filtered or unexported fields }
func NewKademlia ¶
type KademliaCore ¶
type KademliaCore struct {
// contains filtered or unexported fields
}
func (*KademliaCore) FindNode ¶
func (kc *KademliaCore) FindNode(args *FindNodeRequest, response *FindNodeResponse) error
func (*KademliaCore) Ping ¶
func (kc *KademliaCore) Ping(args *PingRequest, response *PingResponce) error
type NodeID ¶
func NewRandomNodeID ¶
func NewRandomNodeID() (ret NodeID)
type PingRequest ¶
type PingRequest struct {
RPCHeader
}
type PingResponce ¶
type PingResponce struct {
RPCHeader
}
type RPCHeader ¶
type RPCHeader struct { Sender *Contract // contains filtered or unexported fields }
type RoutingTable ¶
type RoutingTable struct {
// contains filtered or unexported fields
}
func NewRoutingTable ¶
func NewRoutingTable(node *Contract) (ret *RoutingTable)
func (*RoutingTable) FindClosest ¶
func (table *RoutingTable) FindClosest(target NodeID, count int) (ret []interface{})
func (*RoutingTable) Update ¶
func (table *RoutingTable) Update(contract *Contract)
Click to show internal directories.
Click to hide internal directories.