engine

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2026 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Overview

Package engine is the engine interface, implemented at engine/singbox

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

type Engine interface {
	// Start builds and starts a fresh instance for n, tun or not
	Start(n domain.Node, tun bool) error
	// Stage builds the kill-switch instance without starting its tun
	Stage() error
	// Block arms the kill switch, a rejecting tun
	Block() error
	// Swap hot-swaps the active outbound/endpoint to n without rebuilding.
	Swap(n domain.Node) error
	// TunAdd/TunRemove hot-toggle the TUN inbound on an already-running engine.
	TunAdd() error
	TunRemove() error
	// Close tears the instance down, waiting for the tun to disappear
	Close() error
}

Engine drives one running proxy/TUN session for a single node.

type New

type New func(s domain.Settings, logPath string) Engine

type Probe

type Probe func(nodes []domain.Node, s domain.Settings, logPath string) (map[string]Result, error)

type Result

type Result struct {
	Alive bool
	MS    int
}

Result is one node's probed reachability.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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