Documentation
¶
Index ¶
- Constants
- func Dial(ip string) *rpc.Client
- func GetLocalAddress() string
- func Ping(addr string) bool
- type IP
- type KVMap
- type KVPair
- type Node
- func (n *Node) CheckPre() error
- func (n *Node) ClosestPrecedingNode(id *big.Int) IP
- func (n *Node) Create() error
- func (n *Node) Delete(key string) bool
- func (n *Node) DeleteDataPre(key string, _ *bool) error
- func (n *Node) DeleteInside(key string, _ *bool) error
- func (n *Node) ExtractData(id *big.Int, ret *map[string]string) error
- func (n *Node) FindSuc(id *big.Int, ret *IP) error
- func (n *Node) FixSuc() error
- func (n *Node) Get(key string) (bool, string)
- func (n *Node) GetData(_ *int, ret *map[string]string) error
- func (n *Node) GetInside(key string, val *string) error
- func (n *Node) GetPre(_ *int, ret *IP) error
- func (n *Node) Id(_ *int, ret *big.Int) error
- func (n *Node) ImportData(dat map[string]string, _ *bool) error
- func (n *Node) Init(port string)
- func (n *Node) Join(ip string) error
- func (n *Node) Maintain()
- func (n *Node) MaintainSuc() error
- func (n *Node) MergeDataPre()
- func (n *Node) Notify(pre *IP, suc *bool) error
- func (n *Node) Put(key, val string) error
- func (n *Node) PutDataPre(kv KVPair, _ *bool) error
- func (n *Node) PutInside(kv KVPair, _ *bool) error
- func (n *Node) Quit() error
- func (n *Node) Run()
- func (n *Node) SetDataPre(dat map[string]string, _ *bool) error
- func (n *Node) SetSuc(suc *[SucLen - 1]IP, _ *bool) error
- func (n *Node) Stablize() error
- func (n *Node) Stop()
- func (n *Node) UpdatePre(ip *IP, _ *bool) error
- func (n *Node) UpdateSuc(suc *IP, _ *bool) error
Constants ¶
View Source
const ( M = 160 SucLen = 20 MaintainInterval = second / 4 )
Variables ¶
This section is empty.
Functions ¶
func GetLocalAddress ¶
func GetLocalAddress() string
Types ¶
type Node ¶
type Node struct { Self IP Finger [M]IP Pre IP Suc [SucLen]IP Data KVMap DataPre KVMap Lock sync.Mutex On bool Joined bool Server *rpc.Server Listen net.Listener // contains filtered or unexported fields }
func (*Node) MaintainSuc ¶
func (*Node) MergeDataPre ¶
func (n *Node) MergeDataPre()
Click to show internal directories.
Click to hide internal directories.