core

package
v0.0.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Core

type Core interface {
	Start() error
	Close() error

	AddNode(tag string, info *api.NodeInfo) error
	DelNode(tag string) error

	AddUsers(tag string, users []api.UserInfo) (added int, err error)
	DelUsers(tag string, users []api.UserInfo) error

	// GetUserTraffic returns per-user byte counters for a node; reset=true
	// atomically zeroes them after read (reset-then-report, doc/10 §7.1).
	GetUserTraffic(tag string, reset bool) ([]api.UserTraffic, error)
	OnlineIPs(tag string) ([]api.OnlineUser, error)

	Protocols() []string
	Type() string
}

Core is the engine-neutral backend interface: lifecycle + per-node/per-user CRUD + traffic/online readout + capability introspection. AddNode consumes a neutralized *api.NodeInfo (doc/10 §3.1). The base fork exposes no incremental user API — only whole-set UpdateUsers — so AddUsers/DelUsers land as full replacements: the core/singbox wrapper holds the authoritative per-tag user set, merges each diff into it, and re-pushes the complete list (doc/11 §4.3).

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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