message

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2024 License: GPL-3.0 Imports: 1 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	MsgConnect = MessageType(iota + 1)
	MsgPingReq
	MsgPingResp
	MsgSystem
	MsgAppHandshake
	MsgApplication
	MsgDownloader
	MsgNewBlock
	MsgDisconnect
	MsgTransaction
	MsgTypeFirstInvalid
)
View Source
const (
	GossipPrefix             = "amc/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.

Jump to

Keyboard shortcuts

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