package
Version:
v0.1.0
Opens a new window with list of versions in this module.
Published: Sep 2, 2021
License: GPL-3.0
Opens a new window with license information.
Imports: 7
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
Documentation
¶
View Source
const (
CmdQuestion = "question"
CmdVersion = "version"
CmdRoots = "roots"
CmdMessages = "messages"
CmdPing = "ping"
CmdPong = "pong"
CmdUser = "user"
CmdPeers = "peers"
CmdErr = "error"
)
Commands used in wave which describe the type of wave.
CommandSize is the fixed size of all commands
WaveHeaderSize is the number of bytes in a wave header
command 12 bytes + length 4 bytes + checksum 4 bytes
WaveSize is the number of bytes in a wave
WaveHeaderSize 24 bytes + waveBody
SendWave send a wave message to w
type Wave interface {
Command() string
}
Wave is an interface that describes a galaxy information.
ReceiveWave receive a wave message from r
type WaveErr struct {
WaveID common.Hash `json:"waveID"`
Err string `json:"err"`
}
WaveErr return err of wave questions
func (*WaveErr) Command ¶
Command returns the protocol command string for the wave.
type WaveMessages struct {
WaveID common.Hash `json:"waveID"`
Msgs [][]byte `json:"msgs"`
}
WaveMessages implements the Wave interface and represents a broadcast new message.
func (*WaveMessages) Command ¶
Command returns the protocol command string for the wave.
type WavePeers struct {
WaveID common.Hash `json:"waveID"`
Peers [][]byte `json:"peers"`
}
WavePeers implements the Wave interface and represent node peers.
func (*WavePeers) Command ¶
Command returns the protocol command string for the wave.
type WavePing struct {
WaveID common.Hash `json:"waveID"`
}
WavePing implements the Wave interface and represents a ping message
func (*WavePing) Command ¶
Command returns the protocol command string for the wave.
type WavePong struct {
WaveID common.Hash `json:"waveID"`
}
WavePong implements the Wave interface and represents a pong message
func (*WavePong) Command ¶
Command returns the protocol command string for the wave.
type WaveQuestion struct {
WaveID common.Hash `json:"waveID"`
Cmd string `json:"cmd"`
Args [][]byte `json:"args"`
}
WaveQuestion implements the Wave interface and represents request info message.
func (*WaveQuestion) Command ¶
Command returns the protocol command string for the wave.
type WaveRoots struct {
WaveID common.Hash `json:"waveID"`
Users [2]*core.User `json:"users"`
}
WaveRoots implements the Wave interface and represents a getRoots message.
func (*WaveRoots) Command ¶
Command returns the protocol command string for the wave.
type WaveUser struct {
WaveID common.Hash `json:"waveID"`
}
WaveUser implements the Wave interface and represents a checkUser message.
func (*WaveUser) Command ¶
Command returns the protocol command string for the wave.
type WaveVersion struct {
WaveID common.Hash `json:"waveID"`
}
WaveVersion implements the Wave interface and represents a galaxy protocol version message.
func (*WaveVersion) Command ¶
Command returns the protocol command string for the wave.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.