api

package
v2.0.0-...-dbcdbcc Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2026 License: GPL-3.0 Imports: 34 Imported by: 0

Documentation

Overview

Package api provides REST API endpoints for the node service.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

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

Server provides REST API for managing the node.

func NewServer

func NewServer(port int, xrayManager *xray.Manager, telemtManager *telemt.Manager, amneziawgManager *amneziawg.Manager) *Server

NewServer creates a new API server instance. Call SetPairing before Start (pairing-only).

func (*Server) SetMTLSClientCA

func (s *Server) SetMTLSClientCA(caFile string)

SetMTLSClientCA sets the PEM file with CA certificate(s) used to verify client certificates (panel). Requires SetTLS; connections without a valid client cert are rejected before handlers run.

func (*Server) SetPairing

func (s *Server) SetPairing(b *auth.Bundle)

SetPairing configures JWT verification from SECRET_KEY.

func (*Server) SetTLS

func (s *Server) SetTLS(certFile, keyFile string)

SetTLS sets TLS certificate files for HTTPS.

func (*Server) Start

func (s *Server) Start() error

Start starts the HTTP server.

func (*Server) Stop

func (s *Server) Stop() error

Stop stops the HTTP server.

Jump to

Keyboard shortcuts

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