Documentation
¶
Index ¶
- type Conn
- func (m *Conn) Close() error
- func (m *Conn) LocalAddr() net.Addr
- func (m *Conn) Read(b []byte) (int, error)
- func (m *Conn) RemoteAddr() net.Addr
- func (m *Conn) SetDeadline(t time.Time) error
- func (m *Conn) SetReadDeadline(t time.Time) error
- func (m *Conn) SetWriteDeadline(t time.Time) error
- func (m *Conn) Write(b []byte) (int, error)
- type MConn
- func (m *MConn) FlushStop()
- func (m *MConn) Send(ch byte, data []byte) bool
- func (m *MConn) SetLogger(_ *slog.Logger)
- func (m *MConn) Start() error
- func (m *MConn) Status() conn.ConnectionStatus
- func (m *MConn) Stop() error
- func (m *MConn) String() string
- func (m *MConn) TrySend(ch byte, data []byte) bool
- type Peer
- func (m *Peer) CloseConn() error
- func (m *Peer) FlushStop()
- func (m *Peer) Get(key string) any
- func (m *Peer) ID() types.ID
- func (m *Peer) IsOutbound() bool
- func (m *Peer) IsPersistent() bool
- func (m *Peer) IsPrivate() bool
- func (m *Peer) NodeInfo() types.NodeInfo
- func (m *Peer) RemoteAddr() net.Addr
- func (m *Peer) RemoteIP() net.IP
- func (m *Peer) Send(classifier byte, data []byte) bool
- func (m *Peer) Set(key string, data any)
- func (m *Peer) SocketAddr() *types.NetAddress
- func (m *Peer) Status() conn.ConnectionStatus
- func (m *Peer) Stop() error
- func (m *Peer) TrySend(classifier byte, data []byte) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Conn ¶
type Conn struct {
ReadFn readDelegate
WriteFn writeDelegate
CloseFn closeDelegate
LocalAddrFn localAddrDelegate
RemoteAddrFn remoteAddrDelegate
SetDeadlineFn setDeadlineDelegate
SetReadDeadlineFn setDeadlineDelegate
SetWriteDeadlineFn setDeadlineDelegate
}
func (*Conn) RemoteAddr ¶
type MConn ¶
type MConn struct {
FlushFn flushStopDelegate
StartFn startDelegate
StopFn stopDelegate
SendFn sendDelegate
TrySendFn trySendDelegate
StatusFn statusDelegate
StringFn stringDelegate
}
func (*MConn) Status ¶
func (m *MConn) Status() conn.ConnectionStatus
type Peer ¶
type Peer struct {
service.BaseService
FlushStopFn flushStopDelegate
IDFn idDelegate
RemoteIPFn remoteIPDelegate
RemoteAddrFn remoteAddrDelegate
IsOutboundFn isOutboundDelegate
IsPersistentFn isPersistentDelegate
IsPrivateFn isPrivateDelegate
CloseConnFn closeConnDelegate
NodeInfoFn nodeInfoDelegate
StopFn stopDelegate
StatusFn statusDelegate
SocketAddrFn socketAddrDelegate
SendFn sendDelegate
TrySendFn trySendDelegate
SetFn setDelegate
GetFn getDelegate
}
func GeneratePeers ¶
GeneratePeers generates random peers
func (*Peer) IsOutbound ¶
func (*Peer) IsPersistent ¶
func (*Peer) RemoteAddr ¶
func (*Peer) SocketAddr ¶
func (m *Peer) SocketAddr() *types.NetAddress
func (*Peer) Status ¶
func (m *Peer) Status() conn.ConnectionStatus
Click to show internal directories.
Click to hide internal directories.