Documentation ¶
Index ¶
- Constants
- type AddrInfo
- type ChannelType
- type DirectRoute
- func (route *DirectRoute) ChannelType() ChannelType
- func (route *DirectRoute) Destination() (result net.IP)
- func (route *DirectRoute) Latency() time.Duration
- func (route *DirectRoute) MeasureLatency(ctx context.Context)
- func (route *DirectRoute) SetDestination(ip net.IP)
- func (route *DirectRoute) TimedOutFraction() float64
- type Logger
- type PathStatistics
- type Peer
- func (peer *Peer) DirectRoutes() (result []*DirectRoute)
- func (peer *Peer) ID() PeerID
- func (peer *Peer) IP() (result net.IP)
- func (peer *Peer) LockDo(fn func())
- func (peer *Peer) MeasureLatencies(ctx context.Context) context.Context
- func (peer *Peer) RLockDo(fn func())
- func (peer *Peer) SetDirectRoute(chType ChannelType, ip net.IP)
- func (peer *Peer) SetIP(newIP net.IP)
- func (peer *Peer) Stream() (result Stream)
- type PeerID
- type ReconnectableStream
- type Router
- func (router *Router) Close() error
- func (router *Router) ConsiderKnownPeer(peerAddr AddrInfo)
- func (router *Router) GetPeer(peerID PeerID) *Peer
- func (router *Router) IsBadAddress(maddr multiaddr.Multiaddr) bool
- func (router *Router) NewIncomingStream(stream Stream, peerAddr AddrInfo)
- func (router *Router) OnNewRoute(peerID PeerID, chType vpn.ChannelType, ip net.IP)
- func (router *Router) OnPeerConnect(peerID PeerID)
- func (router *Router) OnRemoveRoute(peerID PeerID, chType vpn.ChannelType)
- func (router *Router) OnUpdateMyIP(ip net.IP)
- func (router *Router) ProtocolID() protocol.ID
- func (router *Router) SetID(id PeerID)
- func (router *Router) SetMyAddrs(addrs []multiaddr.Multiaddr)
- func (router *Router) SetNetwork(mesh *network.Network)
- func (router *Router) SetPSK(psk []byte)
- func (router *Router) SetPrivateKey(privKey ed25519.PrivateKey)
- func (router *Router) Start() error
- type Stream
Constants ¶
View Source
const ( ChannelType_undefined = vpn.ChannelType_undefined ChannelTypeDirect = vpn.ChannelTypeDirect ChannelTypeIPFS = vpn.ChannelTypeIPFS ChannelTypeTunnel = vpn.ChannelTypeTunnel ChannelTypeAutoRouted = vpn.ChannelTypeAutoRouted )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChannelType ¶
type ChannelType = vpn.ChannelType
type DirectRoute ¶
type DirectRoute struct {
// contains filtered or unexported fields
}
func (*DirectRoute) ChannelType ¶
func (route *DirectRoute) ChannelType() ChannelType
func (*DirectRoute) Destination ¶
func (route *DirectRoute) Destination() (result net.IP)
func (*DirectRoute) Latency ¶
func (route *DirectRoute) Latency() time.Duration
func (*DirectRoute) MeasureLatency ¶
func (route *DirectRoute) MeasureLatency(ctx context.Context)
func (*DirectRoute) SetDestination ¶
func (route *DirectRoute) SetDestination(ip net.IP)
func (*DirectRoute) TimedOutFraction ¶
func (route *DirectRoute) TimedOutFraction() float64
type PathStatistics ¶
type PathStatistics struct {
// contains filtered or unexported fields
}
func (*PathStatistics) Consider ¶
func (stats *PathStatistics) Consider(latency time.Duration, isLoss bool)
func (*PathStatistics) Latency ¶
func (stats *PathStatistics) Latency() (result time.Duration)
func (*PathStatistics) LockDo ¶
func (stats *PathStatistics) LockDo(fn func())
func (*PathStatistics) RLockDo ¶
func (stats *PathStatistics) RLockDo(fn func())
func (*PathStatistics) TimedOut ¶
func (stats *PathStatistics) TimedOut() (result float64)
type Peer ¶
type Peer struct {
// contains filtered or unexported fields
}
func (*Peer) DirectRoutes ¶
func (peer *Peer) DirectRoutes() (result []*DirectRoute)
func (*Peer) MeasureLatencies ¶
func (*Peer) SetDirectRoute ¶
func (peer *Peer) SetDirectRoute(chType ChannelType, ip net.IP)
type ReconnectableStream ¶
type ReconnectableStream = helpers.ReconnectableStream
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
func (*Router) ConsiderKnownPeer ¶
func (*Router) IsBadAddress ¶
func (*Router) NewIncomingStream ¶
func (*Router) OnNewRoute ¶
func (*Router) OnPeerConnect ¶
func (*Router) OnRemoveRoute ¶
func (router *Router) OnRemoveRoute(peerID PeerID, chType vpn.ChannelType)
func (*Router) OnUpdateMyIP ¶
func (*Router) ProtocolID ¶
func (*Router) SetMyAddrs ¶
func (router *Router) SetMyAddrs(addrs []multiaddr.Multiaddr)
func (*Router) SetNetwork ¶
func (*Router) SetPrivateKey ¶
func (router *Router) SetPrivateKey(privKey ed25519.PrivateKey)
Click to show internal directories.
Click to hide internal directories.