package
0.0.0-20231224052254-3c905e5ef12b
Repository: https://github.com/assetcloud/chain.git
Documentation: pkg.go.dev

# Packages

Package broadcast broadcast protocol.
No description provided by the author
No description provided by the author
No description provided by the author

# Functions

AuthenticateMessage authenticates p2p message.
AwaitEOF waits for an EOF on the given stream, returning an error if that fails.
ClearEventHandler clear event handler map, plugin存在多个p2p实例测试,会导致重复注册,需要清除.
CloseStream closes the stream after writing, and waits for the EOF.
EventHandlerWithRecover warps the event handler with recover for catching the panic while processing message.
GetEventHandler gets event handler by event ID.
HandlerWithAuth wraps HandlerWithRead with authenticating.
HandlerWithAuthAndSign wraps HandlerWithRW with signing and authenticating.
HandlerWithClose wraps handler with closing stream and recovering from panic.
HandlerWithRead wraps handler with reading, closing stream and recovering from panic.
HandlerWithRW wraps handler with reading, writing, closing stream and recovering from panic.
HandlerWithWrite wraps handler with writing, closing stream and recovering from panic.
InitAllProtocol initials all protocols.
ReadStream reads message from stream.
ReadStreamAndAuthenticate verifies the message after reading it from the stream.
RegisterEventHandler registers a handler with an event ID.
RegisterProtocolInitializer registers the initial function.
RegisterStreamHandler registers stream handler.
SignAndWriteStream signs the message before writing it to the stream.
WithEventOptInline invoke event callback inline.
WriteStream writes message to stream.

# Variables

EOFTimeout is the maximum amount of time to wait to successfully observe an EOF on the stream.
ErrExpectedEOF is returned when we read data while expecting an EOF.

# Structs

EventHandler chain internal event handler.
P2PEnv p2p全局公共变量.

# Interfaces

IConnManager is interface of ConnManager.
IPeerInfoManager is interface of PeerInfoManager.

# Type aliases

EventHandlerFunc event handler call back.
EventOpt event options.
Initializer is a initial function which any protocol should have.