Documentation
¶
Index ¶
- type CallBack
- type MisbehaveResult
- type Misbehavior
- type Protocol
- func (p *Protocol) Connected(ctx *tentacle.ProtocolContextRef, version string)
- func (p *Protocol) Disconnected(ctx *tentacle.ProtocolContextRef)
- func (p *Protocol) GlobalIPOnly(globalIPOnly bool) *Protocol
- func (p *Protocol) Init(ctx *tentacle.ProtocolContext)
- func (p *Protocol) Notify(ctx *tentacle.ProtocolContext, token uint64)
- func (p *Protocol) Received(ctx *tentacle.ProtocolContextRef, data []byte)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CallBack ¶
type CallBack interface {
// Received custom message
ReceivedIdentify(*tentacle.ProtocolContextRef, []byte) *MisbehaveResult
// Get custom identify message
Identify() []byte
// Get local listen addresses
LocalListenAddrs() []multiaddr.Multiaddr
// Add remote peer's listen addresses
AddRemoteListenAddrs(secio.PeerID, []multiaddr.Multiaddr)
// Add our address observed by remote peer
AddObservedAddr(secio.PeerID, multiaddr.Multiaddr, tentacle.SessionType) *MisbehaveResult
// Report misbehavior
Misbehave(secio.PeerID, Misbehavior) *MisbehaveResult
}
CallBack to communicate with underlying peer storage
type MisbehaveResult ¶
type MisbehaveResult struct {
// contains filtered or unexported fields
}
MisbehaveResult report result
type Misbehavior ¶
type Misbehavior struct {
// contains filtered or unexported fields
}
Misbehavior to report to underlying peer storage
func (*Misbehavior) String ¶
func (m *Misbehavior) String() string
type Protocol ¶
type Protocol struct {
// contains filtered or unexported fields
}
Protocol identify protocol stuct
func NewProtocol ¶
NewProtocol create a identify protocol
func (*Protocol) Connected ¶
func (p *Protocol) Connected(ctx *tentacle.ProtocolContextRef, version string)
Connected ..
func (*Protocol) Disconnected ¶
func (p *Protocol) Disconnected(ctx *tentacle.ProtocolContextRef)
Disconnected ..
func (*Protocol) GlobalIPOnly ¶
GlobalIPOnly turning off global ip only mode will allow any ip to be broadcast, default is true
Click to show internal directories.
Click to hide internal directories.