Versions in this module Expand all Collapse all v0 v0.12.0 Jul 28, 2026 v0.11.1 Jun 26, 2026 v0.11.0 Jun 22, 2026 Changes in this version + type DHT struct + func NewDHT(selfID DHTID, selfPeer string, mesh *Mesh, logger *slog.Logger) *DHT + func (d *DHT) AddContact(contact *DHTContact) + func (d *DHT) AllContacts() []*DHTContact + func (d *DHT) Bootstrap(ctx context.Context, contacts []*DHTContact) + func (d *DHT) ClosestContacts(target DHTID, count int) []*DHTContact + func (d *DHT) HandleFindNodeResponse(snaps []PeerSnapshot) + func (d *DHT) RemoveContact(id DHTID) + func (d *DHT) Snapshot() ([]byte, error) + func (d *DHT) Start(ctx context.Context) + func (d *DHT) Stop() + type DHTBucket struct + type DHTContact struct + Addr string + ID DHTID + LastSeen time.Time + PeerID string + PubKey string + type DHTID [20]byte + func NewDHTID(pubkey []byte) DHTID + func (id DHTID) Distance(other DHTID) DHTID + func (id DHTID) Less(other DHTID) bool + func (id DHTID) String() string + type NATConfig struct + DialTimeout time.Duration + EnableHolePunch bool + Logger *slog.Logger + RelayPeers []string + STUNServers []string + func DefaultNATConfig() NATConfig + type NATTraversal struct + func NewNATTraversal(cfg NATConfig) *NATTraversal + func (n *NATTraversal) Dial(ctx context.Context, peerAddr string, peerPublicAddr *PublicAddr) (net.Conn, error) + func (n *NATTraversal) DiscoverPublicAddr(ctx context.Context, localPort int) (*PublicAddr, error) + type PublicAddr struct + IP net.IP + Port int + func (a PublicAddr) String() string + type RelayServer struct + func NewRelayServer(addr string, logger *slog.Logger) *RelayServer + func (r *RelayServer) Addr() string + func (r *RelayServer) Close() error + func (r *RelayServer) Start(ctx context.Context) error v0.10.0 Jun 20, 2026 v0.9.3 Jun 8, 2026 Changes in this version + const MaxGossipMessageBytes + var ErrIdentityNotLoaded = errors.New("netlink: identity not loaded") + func DeriveSecretKey(localPub, remotePub []byte) [32]byte + func TLSConfigFor(leaf LoadedCert, rootCAs *x509.CertPool, serverName string) (*tls.Config, error) + type GossipMessage struct + Container *RemoteContainer + From string + Nonce string + Peers []PeerSnapshot + Signature string + Time int64 + Type string + func (m *GossipMessage) Sign(priv []byte) error + func (m *GossipMessage) Verify(pub []byte) error + type Identity struct + func NewIdentity(root string) (*Identity, error) + func (id *Identity) CACert() *x509.Certificate + func (id *Identity) CACertPEM() []byte + func (id *Identity) CAKeyPEM() []byte + func (id *Identity) InstallID() string + func (id *Identity) IssueLinkCert(commonName string) (LoadedCert, error) + func (id *Identity) IssueLinkCertForContainer(containerID string) (LoadedCert, error) + func (id *Identity) PeerKeyFile(peerID string) string + func (id *Identity) PrivateKey() ed25519.PrivateKey + func (id *Identity) PublicKey() ed25519.PublicKey + func (id *Identity) PublicKeyPEM() string + func (id *Identity) ShortID() string + func (id *Identity) Sign(msg []byte) []byte + func (id *Identity) Verify(msg, sig []byte) bool + type LoadedCert struct + KeyDER []byte + Leaf *x509.Certificate + type MDNSEntry struct + Addr string + ID string + Port int + PubKey string + Seen time.Time + Source string + type MDNSService struct + func NewMDNSService(identity *Identity, port int, logger *slog.Logger) *MDNSService + func (m *MDNSService) Entries() []MDNSEntry + func (m *MDNSService) Start(ctx context.Context) error + func (m *MDNSService) Stop() error + type Mesh struct + func NewMesh(cfg MeshConfig) (*Mesh, error) + func (m *Mesh) AnnounceContainer(c RemoteContainer) error + func (m *Mesh) Peer(id string) *Peer + func (m *Mesh) Peers() []*Peer + func (m *Mesh) SendHello(addr string) error + func (m *Mesh) Start(ctx context.Context) error + func (m *Mesh) Stop() error + type MeshConfig struct + EnableMDNS bool + Identity *Identity + ListenAddr string + Logger *slog.Logger + Static *StaticPeers + Trust *TrustStore + type Peer struct + Addr string + CACert string + Containers []RemoteContainer + ID string + LastSeen time.Time + Name string + PubKey string + type PeerSnapshot struct + Addr string + ID string + PubKey string + type RemoteContainer struct + HostPort uint16 + ID string + IP string + Name string + Port uint16 + Proto string + type SecretboxWrapper struct + func NewSecretboxWrapper(key [32]byte) *SecretboxWrapper + func (s *SecretboxWrapper) UnwrapInbound(payload []byte) ([]byte, error) + func (s *SecretboxWrapper) WrapClient(ctx context.Context, c net.Conn) (net.Conn, error) + func (s *SecretboxWrapper) WrapOutbound(payload []byte) ([]byte, error) + func (s *SecretboxWrapper) WrapServer(ctx context.Context, c net.Conn) (net.Conn, error) + type StaticPeers struct + func NewStaticPeers(path string) (*StaticPeers, error) + func (sp *StaticPeers) Add(p *Peer) error + func (sp *StaticPeers) Get(id string) *Peer + func (sp *StaticPeers) List() []*Peer + func (sp *StaticPeers) Remove(id string) error + func (sp *StaticPeers) Touch(id string) + type StaticPeersConfig struct + Peers []*Peer + type TCPProxy struct + func NewTCPProxy(cfg TCPProxyConfig) *TCPProxy + func (p *TCPProxy) Addr() string + func (p *TCPProxy) Close() error + func (p *TCPProxy) Start(ctx context.Context) error + type TCPProxyConfig struct + IdleTimeout time.Duration + ListenAddr string + Logger *slog.Logger + Upstream string + Wrap TransportWrapper + type TLSWrapper struct + func NewTLSWrapper(cfg *tls.Config) *TLSWrapper + func (t *TLSWrapper) WrapClient(ctx context.Context, c net.Conn) (net.Conn, error) + func (t *TLSWrapper) WrapServer(ctx context.Context, c net.Conn) (net.Conn, error) + type TransportWrapper interface + WrapClient func(ctx context.Context, c net.Conn) (net.Conn, error) + WrapServer func(ctx context.Context, c net.Conn) (net.Conn, error) + type TrustStore struct + func NewTrustStore(dir string) (*TrustStore, error) + func (ts *TrustStore) CACert(peerID string) *x509.Certificate + func (ts *TrustStore) ListIDs() []string + func (ts *TrustStore) Load() error + func (ts *TrustStore) PubKey(peerID string) (ed25519.PublicKey, error) + func (ts *TrustStore) Trust(peerID string, pub ed25519.PublicKey, ca *x509.Certificate) error + func (ts *TrustStore) Trusted(peerID string) bool + type UDPProxy struct + func NewUDPProxy(cfg UDPProxyConfig) *UDPProxy + func (p *UDPProxy) Addr() string + func (p *UDPProxy) Close() error + func (p *UDPProxy) Start(ctx context.Context) error + type UDPProxyConfig struct + ListenAddr string + Logger *slog.Logger + MaxSessions int + ReadBufSize int + SessionTimeout time.Duration + Upstream string + Wrap TransportWrapper