Documentation ¶
Index ¶
- Variables
- type Finger
- type Node
- type RPCNode
- func (node *RPCNode) Check(arg *string, reply *string) error
- func (node *RPCNode) GetId(_ *string, id *[]byte) error
- func (node *RPCNode) GetPredecessor(_ *string, reply *string) error
- func (node *RPCNode) GetValue(key *string, value *string) error
- func (node *RPCNode) Notify(predAddr *string, _ *string) error
- func (node *RPCNode) Retrieve(key *string, value *string) error
- func (node *RPCNode) Save(arr []string, storeNode *string) error
- func (node *RPCNode) SetData(data *map[string]string, _ *string) error
- func (node *RPCNode) SetPredecessor(predAddr *string, _ *string) error
- func (node *RPCNode) SetSuccessor(successorAddr *string, _ *string) error
- func (node *RPCNode) Successor(id []byte, rpcAddr *string) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrUnableToListen = errors.New("error: rpc server unable to listen on specified addr:port") ErrUnableToDial = errors.New("error: unable to dial the address of rpc server") ErrFailedToReach = errors.New("error: unable to reach rpc server") ErrNodeAlreadyExists = errors.New("error: node with same id already exists") ErrNoKeyValuePair = errors.New("error: key value pair not found") ErrNilPredecessor = errors.New("error: predecessor does not exists") )
Functions ¶
This section is empty.
Types ¶
type Finger ¶
type Finger struct {
// contains filtered or unexported fields
}
Each ith finger represents the node which is atleast at a distance of 2^(i - 1) from current node
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
Node is an individual entity/worker/machine in the chord network.
type RPCNode ¶
type RPCNode struct { // promoted anonymous field *Node }
This structure houses rpc methods of Node
func (*RPCNode) GetPredecessor ¶
Returns predecessor of the node
func (*RPCNode) GetValue ¶
Returns the value associated with following key if the node has the pair in its store else returns an error
func (*RPCNode) SetPredecessor ¶
manually set predecessor of node
func (*RPCNode) SetSuccessor ¶
manually set successor of node
Source Files ¶
Click to show internal directories.
Click to hide internal directories.