Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Message ¶
type Message struct { From kad.ID PrefixLen uint16 Hash [hashSize]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 broadcasted. Unlike relay messages, broadcast messages do not have SeenPeers because the number of seen peers could be much larger.
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.