tailnet

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 30, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Index

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 NewBind

func NewBind(cfg Config) (*Bind, error)

func (*Bind) BatchSize

func (b *Bind) BatchSize() int

func (*Bind) Close

func (b *Bind) Close() error

func (*Bind) CurrentEndpoints

func (b *Bind) CurrentEndpoints() []EndpointCandidate

func (*Bind) Open

func (b *Bind) Open(port uint16) ([]batchudp.ReceiveFunc, uint16, error)

func (*Bind) ParseEndpoint

func (b *Bind) ParseEndpoint(text string) (batchudp.Endpoint, error)

func (*Bind) RemovePeer

func (b *Bind) RemovePeer(key controlproto.NodePublic)

func (*Bind) Send

func (b *Bind) Send(bufs [][]byte, endpoint batchudp.Endpoint) error

func (*Bind) SetMark

func (b *Bind) SetMark(uint32) error

func (*Bind) Shutdown

func (b *Bind) Shutdown() error

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 DERPRegionLatency struct {
	RegionID int64
	Latency  time.Duration
	Source   DERPLatencySource
	At       time.Time
}

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
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL