rumour

package
v0.0.0-...-1aec103 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 16, 2022 License: BSD-3-Clause Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// UpdateData is a value to be used for RequestType
	// It is used to say that the Rumour asks for a value to be updated for a key
	UpdateData = "UPDATE-DATA"

	// RTTRequest is a value to be used for RequestType.
	// It is used to ask for an RTT from the receiving node.
	RTTRequest = "RTT-REQUEST"

	// RTTForward is a value to be used for RequestType.
	// It is used to ask for the recieving node to send an RTT on a target node.
	RTTForward = "RTT-FORWARD"

	// RTTForwardResponse is a value to be used for RequestType
	// It is used to send the result for an RTTForward Request
	RTTForwardResponse = "RTT-FORWARD-RESPONSE"

	// SuspiciousNode is a value to be used for RequestType
	// It is used to say that a node is suspicious, therefore should be removed from the
	// receiving node's list of neighbours.
	SuspiciousNode = "MARK-NODE-SUSPICIOUS"

	// FullStateCopyRequest is a value to be used for RequestType
	// It is used to ask a node for a full state copy, i.e. copy its data map over one's
	// own. This is used (a) when a node joins the network and (b) randomly for
	// convergence
	FullStateCopyRequest = "FSC-REQUEST"

	// FullStateCopyResponse is a value to be used for RequestType
	// It is used when responding to a node which as requested a full state copy. Requests
	// which use this type must make use the of the FullState value in the Rumour.
	FullStateCopyResponse = "FSC-RESPONSE"

	// GetValueRequest is a value to be used for RequestType
	// It is used to request for the value of a key
	// Rumours using this RequestType need to have a Key value.
	GetValueRequest = "GET-VALUE-REQ"

	// GetValueResponse is a value to be used for RequestType
	// It is used for rumour which do not change the state of a node
	// Instead the rumour is only used to show what the value of a key is.
	GetValueResponse = "GET-VALUE-RESP"

	// GetNeighboursRequest is a value to be used for RequestType
	// It is to request a list of all the neighbours a node has
	// This can be used when introducing a node to a network, or just by the frontend
	GetNeighboursRequest = "GET-NEIGHBOURS-REQ"

	// GetNeighboursResponse is a value to be used for RequestType
	// It is used for responses that contain a list of neighbours
	// This can be used when introducing a node to a network, or just by the frontend
	GetNeighboursResponse = "GET-NEIGHBOURS-REP"

	// AddNeighbourRequest is a value to be used for RequestType
	// It is used to request a node to add a neighbour to its list of neighbours
	// This is useful for the frontend and for introducing new nodes to a network
	AddNeighbourRequest = "ADD-NEIGHBOUR"

	// DeleteNeighbourRequest is a value to be used for RequestType
	// It is used to request a node to delete a neighbour from its list of neighbours
	// This is useful for the frontend and for handling suspicious or dying nodes
	DeleteNeighbourRequest = "DELETE-NEIGHBOUR"

	// DieRequest is a value to be used for RequestType
	// It is used to request a node to shut itself off
	// This is useful for the frontend and for handling suspicious or dying nodes
	DieRequest = "DIE-REQ"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Rumour

type Rumour struct {
	RequestType string // What type of rumour this is, e.g. update data, RTT request ...
	Sender      string // Shows what node to respond to

	Key      string // The key of the piece of data to be updated
	NewValue string // The new value of the piece of data to be updated
	T        int    // The current round this rumour comes from

	RTTTarget   string // If another node is suspicious, fill this with the suspcious socket
	RTTResponse bool   // true if suspcious, else false

	FullState map[string]string // The full state of the data map, to be used for FSCs

	Neighbours []string // The neighbours of the sending node
}

The primary data structure which is communicated between Nodes

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL