Documentation ¶
Index ¶
- func GetAddress(directory map[uint32]string, id string) string
- type ChordNode
- func (n ChordNode) AddNodeToDirectory()
- func (n *ChordNode) CheckPredecessor()
- func (n *ChordNode) ChordWorker()
- func (n *ChordNode) ClosestPrecedingNode(id uint32) uint32
- func (n *ChordNode) CreateRing(msg *gabs.Container) string
- func (n *ChordNode) FindRingPredecessor() string
- func (n *ChordNode) FindRingSuccessor(id uint32) (uint32, bool, error)
- func (n *ChordNode) FixRingFingers() string
- func (n ChordNode) Get(key string) string
- func (n *ChordNode) GetOwnAddress() string
- func (n ChordNode) GetRingFingers() string
- func (n ChordNode) GetSocketAddress() (string, bool)
- func (n ChordNode) InitRingFingers() string
- func (n *ChordNode) JoinRing(msg *gabs.Container) string
- func (n *ChordNode) LeaveRing(msg *gabs.Container) string
- func (n ChordNode) ListItems() string
- func (n ChordNode) Print()
- func (n *ChordNode) ProcessIncomingCommand(msg string) (string, error)
- func (n *ChordNode) ProcessOrderlyLeave(jsonParsed *gabs.Container) string
- func (n ChordNode) Put(key string, value string) (string, error)
- func (n ChordNode) Remove(key string) string
- func (n *ChordNode) RingNotify(id uint32, replyTo string) string
- func (n *ChordNode) Run()
- func (n *ChordNode) StabilizeRing() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ChordNode ¶
type ChordNode struct { ID uint32 Predecessor *uint32 Successor *uint32 Table [32](*uint32) Address string Port int InRing bool Data map[string]string Directory *map[uint32]string SecondNode bool // This is a janky way for node that created the ring to take // contains filtered or unexported fields }
A node capable of joining and operating a Chord ring
func (ChordNode) AddNodeToDirectory ¶
func (n ChordNode) AddNodeToDirectory()
func (*ChordNode) CheckPredecessor ¶
func (n *ChordNode) CheckPredecessor()
func (*ChordNode) ChordWorker ¶
func (n *ChordNode) ChordWorker()
func (*ChordNode) ClosestPrecedingNode ¶
func (*ChordNode) CreateRing ¶
Respond to an instruction to join a chord ring
func (*ChordNode) FindRingPredecessor ¶
func (*ChordNode) FindRingSuccessor ¶
{"do": "find-ring-successor", "id": id, "reply-to": address}
func (*ChordNode) FixRingFingers ¶
func (*ChordNode) GetOwnAddress ¶
func (ChordNode) GetRingFingers ¶
func (ChordNode) GetSocketAddress ¶
func (ChordNode) InitRingFingers ¶
func (*ChordNode) ProcessIncomingCommand ¶
func (*ChordNode) ProcessOrderlyLeave ¶
func (*ChordNode) StabilizeRing ¶
Click to show internal directories.
Click to hide internal directories.