Documentation
¶
Overview ¶
Package cli 提供 xray-agent 的管理子命令:start / stop / status / restart / logs / upgrade / rollback / uninstall / lang / help。无参数或 run 走主循环(见 cmd/agent/main.go)。
Index ¶
Constants ¶
View Source
const AgentLogEnv = "XRAY_AGENT_LOG_FILE"
AgentLogEnv 手动(无 systemd)后台模式下的 agent 自身日志路径: start 通过环境变量把路径传给子进程,main 里按同一套滑动策略落盘。
Variables ¶
This section is empty.
Functions ¶
func Dashboard ¶ added in v0.2.0
Dashboard 裸执行 `xray-agent` 时的界面:状态头 + 分组命令面板。 之前这里只打一句「已由 systemd 托管」,对运维没有任何信息量。
func IsSystemdManaged ¶
func IsSystemdManaged() bool
IsSystemdManaged 判断本机是否安装了 xray-agent 的 systemd 单元(无论服务是否在运行)。
func IsSystemdService ¶
func IsSystemdService() bool
IsSystemdService 判断当前进程是否由 systemd 拉起:服务进程带 INVOCATION_ID 环境变量, 终端手动执行无此变量——用于区分「服务内启动」与「交互式误启动」。
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.