Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Handle ¶
func Handle(params HandlerParams) error
Handle sends and receives messages no matter outgoing or incoming connection.
Types ¶
type DuplicateChecker ¶ added in v0.8.1
type HandlerParams ¶
type HandlerParams struct {
Ctx context.Context
ID string
Connection conn.Connection
Remote Remote
Parent Parent
Peer Peer
DuplicateChecker DuplicateChecker
}
type InfoMessage ¶
type InfoMessage struct {
Peer Peer
Value interface{}
}
type Parent ¶
type Parent struct {
MessageCh chan ProtoMessage
InfoCh chan InfoMessage
SkipMessageList *messages.SkipMessageList
}
type PeerImpl ¶
type PeerImpl struct {
// contains filtered or unexported fields
}
func NewPeerImpl ¶
func NewPeerImpl(handshake proto.Handshake, conn conn.Connection, direction Direction, remote Remote, cancel context.CancelFunc) *PeerImpl
func (*PeerImpl) Connection ¶
func (a *PeerImpl) Connection() conn.Connection
func (*PeerImpl) RemoteAddr ¶
func (*PeerImpl) SendMessage ¶
type ProtoMessage ¶
type Remote ¶
type Remote struct {
ToCh chan []byte
FromCh chan *bytebufferpool.ByteBuffer
ErrCh chan error
}
Click to show internal directories.
Click to hide internal directories.