docs: define portable config migration
This commit is contained in:
+10
@@ -69,6 +69,16 @@ type TrayState struct {
|
||||
|
||||
原生 adapter 通过结果通道发布 `TrayCommand`,并只接收 `TrayState` 汇总来更新 Tooltip 或图标状态。不得在 DTO 中放入实例名称、路径、URL、代理、PID、CDP 地址或平台句柄;`TrayCommand` 不是实例启动、停止、重启、删除或接管 API。
|
||||
|
||||
本地配置入口统一为:
|
||||
|
||||
```go
|
||||
func DefaultPath() (string, error) // <dir(os.Executable())>\\config.json
|
||||
func LegacyPath() (string, error) // %APPDATA%\\chub\\config.json,仅用于一次迁移
|
||||
func OpenDefault() (*Store, error) // 目标优先;必要时校验并原子迁移 legacy
|
||||
```
|
||||
|
||||
调用方不得把当前工作目录作为配置来源,也不得自行复制、删除或合并 legacy 文件。`OpenDefault` 的迁移是文件级配置迁移,不迁移 `UserDataDir`、日志目录或浏览器文件;目标文件存在、legacy 缺失时均不产生写入。迁移失败返回稳定的配置错误,调用方不得改用 legacy 继续写入。
|
||||
|
||||
## CLI 当前合约
|
||||
|
||||
```text
|
||||
|
||||
Reference in New Issue
Block a user