native

package
v4.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package native implements the wireguard package's one route in the package itself: the administrator's WireGuard server keypair for the protocol form. It reads and stores nothing: the keys are generated for the caller, who saves the private key into a protocol through the kernel's protocol routes (protocol-runtime; v2_node_protocol is a protected kernel table). Responses have the legacy handler's shape (internal/tests/wireguardcompat); the keys are random on both sides.

The answer carries a private key either way: when the route is bridged, the legacy handler's answer passes through this package's host too.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	// Now defaults to time.Now.
	Now func() time.Time
}

Service holds what the native route needs.

func (*Service) Handlers

func (s *Service) Handlers() map[string]pluginhostsdk.NativeHandler

Handlers returns the native handlers by route id.

func (*Service) Keypair

Keypair is POST /api/v2/admin/wireguard/keypair: a new X25519 keypair, both keys in standard base64, as the kernel's service.GenerateWireGuardKeypair generates it. The request body is ignored.

Jump to

Keyboard shortcuts

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