core

package
v3.1.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2026 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterCore

func RegisterCore(t string, f func(c *conf.CoreConfig) (Core, error))

func RegisteredCore

func RegisteredCore() []string

Types

type AddUsersParams

type AddUsersParams struct {
	Tag   string
	Users []panel.UserInfo
	*panel.NodeInfo
}

type Core

type Core interface {
	Start() error
	Close() error
	AddNode(tag string, info *panel.NodeInfo, config *conf.Options) error
	DelNode(tag string) error
	AddUsers(p *AddUsersParams) (added int, err error)
	GetUserTrafficSlice(tag string, reset bool) ([]panel.UserTraffic, error)
	DelUsers(users []panel.UserInfo, tag string, info *panel.NodeInfo) error
	Protocols() []string
	Type() string
}

func NewCore

func NewCore(c []conf.CoreConfig) (Core, error)

func NewSelector

func NewSelector(c []conf.CoreConfig) (Core, error)

type OnlineDeviceProvider

type OnlineDeviceProvider interface {
	GetOnlineDevice(tag string) ([]panel.OnlineUser, error)
}

type RateLimitUpdater

type RateLimitUpdater interface {
	UpdateUserRateLimit(tag, uuid string, speedLimit int) error
}

RateLimitUpdater is implemented by cores whose runtime can enforce a per-user rate outside the protocol parser. WireGuard uses Linux tc rules keyed by each peer address; the existing proxy cores keep their own limiter hooks and do not need to implement this optional interface.

type RuntimeHealthProvider

type RuntimeHealthProvider interface {
	RuntimeHealth(tag string) (healthy bool, message string)
}

RuntimeHealthProvider exposes process-level health for cores that supervise external runtime components. WireGuard uses it for the GOST relay process.

type Selector

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

func (*Selector) AddNode

func (s *Selector) AddNode(tag string, info *panel.NodeInfo, option *conf.Options) error

func (*Selector) AddUsers

func (s *Selector) AddUsers(p *AddUsersParams) (added int, err error)

func (*Selector) Close

func (s *Selector) Close() error

func (*Selector) DelNode

func (s *Selector) DelNode(tag string) error

func (*Selector) DelUsers

func (s *Selector) DelUsers(users []panel.UserInfo, tag string, info *panel.NodeInfo) error

func (*Selector) GetOnlineDevice

func (s *Selector) GetOnlineDevice(tag string) ([]panel.OnlineUser, error)

func (*Selector) GetUserTrafficSlice

func (s *Selector) GetUserTrafficSlice(tag string, reset bool) ([]panel.UserTraffic, error)

func (*Selector) Protocols

func (s *Selector) Protocols() []string

func (*Selector) RollbackUserTrafficSlice

func (s *Selector) RollbackUserTrafficSlice(tag string, traffic []panel.UserTraffic) error

func (*Selector) Start

func (s *Selector) Start() error

func (*Selector) Type

func (s *Selector) Type() string

func (*Selector) UpdateUserRateLimit

func (s *Selector) UpdateUserRateLimit(tag, uuid string, speedLimit int) error

type TrafficRollbacker

type TrafficRollbacker interface {
	RollbackUserTrafficSlice(tag string, traffic []panel.UserTraffic) error
}

TrafficRollbacker lets a core restore a traffic cursor when the panel rejected an otherwise successfully sampled report. It is optional because existing proxy cores do not expose reversible counters.

Directories

Path Synopsis
app
Package app contains the third-party app used to replace the default app in xray-core
Package app contains the third-party app used to replace the default app in xray-core

Jump to

Keyboard shortcuts

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