Documentation ¶
Index ¶
- Constants
- func PostTunnelCleanup(devName string)
- func PostTunnelSetup(localNet *netip.Prefix, devName string) error
- type LocalPeerInfo
- type PeerConnection
- func (c *PeerConnection) ActiveConnectionCount() int
- func (c *PeerConnection) Close()
- func (c *PeerConnection) CloseActiveConnections()
- func (c *PeerConnection) InitiateConnection() (net.Conn, error)
- func (t *PeerConnection) LastActive() time.Time
- func (c *PeerConnection) Send(p *bufferio.BufferArray)
- func (c *PeerConnection) ServeNewConnection(conn net.Conn)
- func (c *PeerConnection) Status() *PeerStatus
- func (c *PeerConnection) StatusText() string
- type PeerStatus
- type PeerTable
- func (t *PeerTable) CloseActiveConnections()
- func (t *PeerTable) GetPeerStatus() []*PeerStatus
- func (t *PeerTable) IsClosed() bool
- func (t *PeerTable) Serve() error
- func (t *PeerTable) ServeFunc(w http.ResponseWriter, r *http.Request)
- func (t *PeerTable) Shutdown()
- func (t *PeerTable) Start()
- func (t *PeerTable) WaitForShutdown() error
Constants ¶
Variables ¶
This section is empty.
Functions ¶
Types ¶
type LocalPeerInfo ¶
type PeerConnection ¶
func NewConnection ¶
func NewConnection(addr string, dialer func(string) (net.Conn, *LocalPeerInfo, error), receiveChan chan *bufferio.BufferArray, maxQueueSize int, localPeerInfo *LocalPeerInfo) *PeerConnection
func (*PeerConnection) ActiveConnectionCount ¶
func (c *PeerConnection) ActiveConnectionCount() int
func (*PeerConnection) Close ¶
func (c *PeerConnection) Close()
func (*PeerConnection) CloseActiveConnections ¶
func (c *PeerConnection) CloseActiveConnections()
CloseActiveConnections closes active connections. If the connection is not marked as closed, it will trigger a reconnect.
func (*PeerConnection) InitiateConnection ¶
func (c *PeerConnection) InitiateConnection() (net.Conn, error)
func (*PeerConnection) LastActive ¶
func (t *PeerConnection) LastActive() time.Time
func (*PeerConnection) Send ¶
func (c *PeerConnection) Send(p *bufferio.BufferArray)
Send takes the ownership of `p`.
func (*PeerConnection) ServeNewConnection ¶
func (c *PeerConnection) ServeNewConnection(conn net.Conn)
func (*PeerConnection) Status ¶
func (c *PeerConnection) Status() *PeerStatus
func (*PeerConnection) StatusText ¶
func (c *PeerConnection) StatusText() string
type PeerStatus ¶
type PeerTable ¶
type PeerTable struct {
// contains filtered or unexported fields
}
func NewPeerTable ¶
func (*PeerTable) CloseActiveConnections ¶
func (t *PeerTable) CloseActiveConnections()
CloseActiveConnections closes active connections. This is used for device events e.g. WIFI connection state changed where all connections become obsoleted.
func (*PeerTable) GetPeerStatus ¶
func (t *PeerTable) GetPeerStatus() []*PeerStatus
Click to show internal directories.
Click to hide internal directories.