adapter

package
v0.0.0-...-2181734 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package adapter implements Polyamide using wireguard-go.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	PrivateKey polyamide.PrivateKey
	ListenPort uint16
	// Nil uses the platform UDP bind.
	NewBind func() conn.Bind
	Logger  *slog.Logger
	Debug   bool
}

type Transport

type Transport struct {
	// contains filtered or unexported fields
}

func New

func New(opts Options) (*Transport, error)

func (*Transport) Close

func (t *Transport) Close() error

func (*Transport) ControlMTU

func (t *Transport) ControlMTU(value polyamide.Peer, selected polyamide.Endpoint) (int, error)

func (*Transport) ListenPort

func (t *Transport) ListenPort() uint16

ListenPort reports the bound UDP port, or zero before Start.

func (*Transport) Peers

func (t *Transport) Peers() []polyamide.PeerStats

func (*Transport) PrepareEndpoint

func (t *Transport) PrepareEndpoint(ctx context.Context, address string) (polyamide.Endpoint, error)

func (*Transport) PreparePeer

func (t *Transport) PreparePeer(ctx context.Context, cfg polyamide.PeerConfig) (polyamide.Peer, error)

func (*Transport) RemovePeer

func (t *Transport) RemovePeer(ctx context.Context, value polyamide.Peer) error

func (*Transport) SendControl

func (t *Transport) SendControl(ctx context.Context, value polyamide.Peer, selected polyamide.Endpoint, payload []byte) error

func (*Transport) SendPackets

func (t *Transport) SendPackets(ctx context.Context, packets []polyamide.OutboundPacket) error

func (*Transport) SetEndpoints

func (t *Transport) SetEndpoints(ctx context.Context, value polyamide.Peer, locators []polyamide.Endpoint) error

func (*Transport) SetHostMTU

func (t *Transport) SetHostMTU(mtu int)

SetHostMTU passes the host MTU to the engine through its TUN event reader.

func (*Transport) Start

func (t *Transport) Start(ctx context.Context, hooks polyamide.Hooks) (err error)

Jump to

Keyboard shortcuts

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