Versions in this module Expand all Collapse all v0 v0.2.0 Nov 3, 2026 v0.1.0 Nov 3, 2026retracted Changes in this version + const KeySize + const MaximumDataSize + const MaximumMessageSize + var ErrInvalidPacket = netutil.ErrInvalidPacket + var ErrPeerBlocked = errors.New("netutils/wireguard: peer blocked") + var ErrPeerNoSession = errors.New("netutils/wireguard: peer has no session") + var ErrPeerNotFound = errors.New("netutils/wireguard: peer not found") + var GenerateKeys = utils.DHGenerate + var MustGenerateKeys = utils.MustDHGenerate + func CheckLocksIgnoreWarning() + func SetLogHandler(handler func(verbosity int, message string)) + type Config struct + DisableStats bool + MaxPeers int + PeerConfigLookup func(Key) (*PeerConfig, error) + ReadQueueSize int + SharedWriteQueue bool + StaticPrivateKey *Key + WriteQueueSize int + type Conn struct + UnderLoad atomicBool + func NewConn(transport Transport, config Config) (*Conn, error) + func (conn *Conn) CaptureStats() (Stats, time.Time) + func (conn *Conn) CheckLocksIgnoreWarning() + func (conn *Conn) Close() error + func (conn *Conn) Peer(peerPubKey Key) (Peer, bool) + func (conn *Conn) PeerWriter(peerPubKey Key) *PeerWriter + func (conn *Conn) PrivateKey() Key + func (conn *Conn) PublicKey() Key + func (conn *Conn) ReadFrom(b []byte) (int, Peer, error) + func (conn *Conn) ReadQueue() <-chan Packet + func (conn *Conn) WriteTo(b []byte, staticPubKey Key) (int, Peer, error) + type ConnStats struct + PeersEvict uint64 + PeersJoin uint64 + SessionsCreate uint64 + SessionsDelete uint64 + type Key = header.Key + func KeyFromBase64(s string) (k Key, err error) + func KeyFromHex(s string) (k Key, err error) + func MustKeyFromBase64(s string) (k Key) + type Packet struct + Data []byte + func (pkt *Packet) From() Peer + func (pkt *Packet) Release() + type Peer interface + Block func() bool + IsBlocked func() bool + RemoteAddr func() netip.AddrPort + StaticPubKey func() Key + Unblock func() bool + Update func(*PeerConfig) + Writer func() *PeerWriter + type PeerConfig struct + Addr netip.AddrPort + DisableAddrRoaming bool + DisableHandshakeInitiation bool + PSK *Key + type PeerStats struct + LastSeen time.Time + RemoteAddr netip.AddrPort + type PeerWriter struct + func (w *PeerWriter) Close() error + func (w *PeerWriter) Peer() (Peer, bool) + func (w *PeerWriter) PeerPublicKey() Key + func (w *PeerWriter) Write(b []byte) (int, error) + func (w *PeerWriter) WriteChunks(chunks [][]byte) (int, error) + func (w *PeerWriter) WriteChunksToPeer(chunks [][]byte) (int, Peer, error) + func (w *PeerWriter) WriteToPeer(b []byte) (int, Peer, error) + type Stats struct + Peers map[Key]PeerStats + type Transport interface + Close func() error + ReadFrom func([]byte) (int, netip.AddrPort, error) + WriteTo func([]byte, netip.AddrPort) (int, error) + type TxStats struct + BytesRecv uint64 + BytesSent uint64 + Handshake struct{ ... } + PacketsRecv uint64 + PacketsSent uint64