package
Version:
v0.2.0
Opens a new window with list of versions in this module.
Published: Oct 27, 2026
License: AGPL-3.0
Opens a new window with license information.
Imports: 6
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Package accounts 管理节点内部账户(relay 入站 UUID)的本地持久化。
权威源约定(05 号文档 §4):节点本地文件 `internal_accounts.json` 是唯一权威,
主控 DB 以回执为准覆盖。文件权限 600,写入用 临时文件 + rename 原子替换。
NewUUID 生成 UUID v4(crypto/rand,不依赖 xray 二进制)。
Store 内部账户存储({tag: uuid})。
New 创建存储(路径由 agent 配置注入,默认 /etc/xray-agent/internal_accounts.json)。
Load 读取全部账户(文件不存在返回空 map;损坏文件返回错误,不静默覆盖)。
Set 写入(或覆盖)tag 的 UUID,原子落盘(临时文件 + rename,权限 600)。
Source Files
¶
Click to show internal directories.
Click to hide internal directories.