Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Message ¶
type Message struct { From kad.ID To kad.ID Hash [hashSize]byte // TODO: Hash should be a method, not a field, since nodes should independently compute the hashes to be safe. SeenPeers []byte // Code is a single byte that indicates the type of Data so that Data can be properly deserialized. Code byte Data []byte // SeqNum is an incrementing sequence number (which wraps around 255, since it is of type byte). Messages with identical Code and Data but different SeqNums will hash differently. SeqNum byte }
Message is a message with typed payload (Code and Data) to be relayed from From to To.
func NewMessage ¶
NewMessage creates a new Message instance.
func (*Message) ChangeSeqNum ¶
ChangeSeqNum changes the message sequence number and rehashes the message.
Click to show internal directories.
Click to hide internal directories.