Documentation
¶
Index ¶
- type Bind
- func (b *Bind) BatchSize() int
- func (b *Bind) Close() error
- func (b *Bind) CurrentEndpoints() []EndpointCandidate
- func (b *Bind) Open(port uint16) ([]batchudp.ReceiveFunc, uint16, error)
- func (b *Bind) ParseEndpoint(text string) (batchudp.Endpoint, error)
- func (b *Bind) RemovePeer(key controlproto.NodePublic)
- func (b *Bind) Send(bufs [][]byte, endpoint batchudp.Endpoint) error
- func (b *Bind) SetMark(uint32) error
- func (b *Bind) Shutdown() error
- func (b *Bind) UpdateDERPMap(derpMap *controlproto.DERPMap, selfHome int64)
- func (b *Bind) UpdatePeer(config PeerConfig)
- type Config
- type DERPLatencyReport
- type DERPLatencySource
- type DERPRegionLatency
- type Endpoint
- type EndpointCandidate
- type PathUpdate
- type PeerConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bind ¶
type Bind struct {
// contains filtered or unexported fields
}
func (*Bind) CurrentEndpoints ¶
func (b *Bind) CurrentEndpoints() []EndpointCandidate
func (*Bind) RemovePeer ¶
func (b *Bind) RemovePeer(key controlproto.NodePublic)
func (*Bind) UpdateDERPMap ¶
func (b *Bind) UpdateDERPMap(derpMap *controlproto.DERPMap, selfHome int64)
func (*Bind) UpdatePeer ¶
func (b *Bind) UpdatePeer(config PeerConfig)
type Config ¶
type Config struct {
Network gonnect.Network
NodePrivate controlproto.PrivateKey
DiscoPrivate controlproto.PrivateKey
TLSConfig *tls.Config
DisableDERP bool
DisableDiscovery bool
Logger *slog.Logger
OnEndpoints func([]EndpointCandidate)
OnPath func(PathUpdate)
OnDERPLatency func(DERPLatencyReport)
}
type DERPLatencyReport ¶
type DERPLatencyReport struct {
Regions []DERPRegionLatency
Full bool
At time.Time
}
type DERPLatencySource ¶
type DERPLatencySource string
DERPLatencySource identifies the network path used to measure a DERP region. STUN is preferred; HTTPS is used when UDP appears unavailable.
const ( DERPLatencySTUN DERPLatencySource = "stun-udp" DERPLatencyHTTPS DERPLatencySource = "https" )
type DERPRegionLatency ¶
type Endpoint ¶
type Endpoint struct {
Addr controlproto.NodePublic
}
type EndpointCandidate ¶
type EndpointCandidate struct {
Addr netip.AddrPort
Type controlproto.EndpointType
}
type PathUpdate ¶
type PathUpdate struct {
NodeKey controlproto.NodePublic
Kind string
Direct netip.AddrPort
Latency time.Duration
At time.Time
}
type PeerConfig ¶
type PeerConfig struct {
NodeKey controlproto.NodePublic
DiscoKey controlproto.DiscoPublic
Endpoints []netip.AddrPort
HomeDERP int64
WireGuardOnly bool
}
Click to show internal directories.
Click to hide internal directories.