Documentation ¶
Index ¶
Constants ¶
View Source
const ( MsgConnect = MessageType(iota + 1) MsgPingReq MsgPingResp MsgSystem MsgAppHandshake MsgApplication MsgDownloader MsgNewBlock MsgDisconnect MsgTransaction MsgTypeFirstInvalid )
View Source
const ( GossipPrefix = "ast/1/" GossipBlockMessage = GossipPrefix + "new_block" GossipSyncState = GossipPrefix + "sync_state" GossipTransactionMessage = GossipPrefix + "new_transaction" )
Variables ¶
View Source
var TopicMappings = map[string]interface{}{
GossipBlockMessage: struct{}{},
GossipSyncState: struct{}{},
GossipTransactionMessage: struct{}{},
}
Functions ¶
This section is empty.
Types ¶
type IMessage ¶
type IMessage interface { Type() MessageType Peer() peer.ID Broadcast() bool Encode() ([]byte, error) Decode(MessageType, []byte) error }
type MessageType ¶
type MessageType uint8
func (MessageType) IsValid ¶
func (mt MessageType) IsValid() bool
func (MessageType) String ¶
func (mt MessageType) String() string
String implements the stringer interface.
Click to show internal directories.
Click to hide internal directories.