Documentation
¶
Overview ¶
Package config 统一管理 Runtime 配置与受管目录布局。
Index ¶
- Variables
- type Layout
- func (l *Layout) AppRoot() string
- func (l *Layout) BackendEntryFile() string
- func (l *Layout) BackendStateFile() string
- func (l *Layout) BuildCacheDir() string
- func (l *Layout) ConfigDir() string
- func (l *Layout) DataDir() string
- func (l *Layout) DebugDir() string
- func (l *Layout) DependencySyncDir(operationID string) (string, error)
- func (l *Layout) DownloadCacheDir() string
- func (l *Layout) DownloadFile(name string) (string, error)
- func (l *Layout) DownloadPartFile(name string) (string, error)
- func (l *Layout) EnvironmentStateFile() string
- func (l *Layout) HistoryDir() string
- func (l *Layout) IdentityKey() string
- func (l *Layout) LogsDir() string
- func (l *Layout) MutationStateFile() string
- func (l *Layout) PluginsDir() string
- func (l *Layout) ProtectedRootDirs() []string
- func (l *Layout) PyProjectFile() string
- func (l *Layout) PythonDir() string
- func (l *Layout) PythonExecutable() string
- func (l *Layout) PythonVersionFile() string
- func (l *Layout) RelayStagingDir() string
- func (l *Layout) RepoDir() string
- func (l *Layout) RepoPreviousDir(operationID string) (string, error)
- func (l *Layout) RepoUpdateDir(operationID string) (string, error)
- func (l *Layout) RepoVersionFile() string
- func (l *Layout) RuntimeCacheDir() string
- func (l *Layout) RuntimeDir() string
- func (l *Layout) RuntimeLogDir() string
- func (l *Layout) RuntimeLogFile(command string, localDate time.Time) (string, error)
- func (l *Layout) ScriptDir() string
- func (l *Layout) StateDir() string
- func (l *Layout) UVCacheDir() string
- func (l *Layout) UVExecutable(version string) (string, error)
- func (l *Layout) UVLockFile() string
- func (l *Layout) UVStagingDir(version, operationID string) (string, error)
- func (l *Layout) UVToolsDir() string
- func (l *Layout) UVVersionDir(version string) (string, error)
- func (l *Layout) UpdateStateFile() string
- func (l *Layout) VenvConfigFile() string
- func (l *Layout) VenvDir() string
- func (l *Layout) VenvPythonExecutable() string
Constants ¶
This section is empty.
Variables ¶
var ( // ErrEmptyPath 表示必需路径为空。 ErrEmptyPath = errors.New("path is empty") // ErrPathContainsNUL 表示路径包含 NUL。 ErrPathContainsNUL = errors.New("path contains nul") // ErrBaseNotAbsolute 表示显式 base 不是绝对路径。 ErrBaseNotAbsolute = errors.New("base path is not absolute") // ErrInvalidPath 表示路径形式无法安全解析。 ErrInvalidPath = errors.New("path is invalid") // ErrAppRootIsRoot 表示 app root 指向卷根。 ErrAppRootIsRoot = errors.New("app root is a volume root") // ErrInvalidSegment 表示动态文件名 segment 非法。 ErrInvalidSegment = errors.New("path segment is invalid") // ErrInvalidLogDate 表示日志日期为零值。 ErrInvalidLogDate = errors.New("log date is invalid") )
Functions ¶
This section is empty.
Types ¶
type Layout ¶
type Layout struct {
// contains filtered or unexported fields
}
Layout 保存一个 app root 的不可变受管目录布局。
func (*Layout) BackendEntryFile ¶
BackendEntryFile 返回受管后端入口文件路径。
func (*Layout) BackendStateFile ¶
BackendStateFile 返回后端状态文件路径。
func (*Layout) DependencySyncDir ¶
DependencySyncDir 返回一次依赖同步中改写锁副本使用的临时项目目录。
该目录位于构建缓存下,属于可丢弃缓存:由 Runtime 在每次镜像尝试前创建、 尝试结束后立即删除,绝不落在 repo 或任何用户数据目录里。
func (*Layout) DownloadCacheDir ¶
DownloadCacheDir 返回下载缓存目录。
func (*Layout) DownloadFile ¶
DownloadFile 返回下载缓存中指定文件的路径。
func (*Layout) DownloadPartFile ¶
DownloadPartFile 返回下载缓存中指定文件的分段下载路径。
func (*Layout) EnvironmentStateFile ¶
EnvironmentStateFile 返回环境状态文件路径。
func (*Layout) MutationStateFile ¶
MutationStateFile 返回变更事务状态文件路径。
func (*Layout) ProtectedRootDirs ¶
ProtectedRootDirs 返回自动流程不得删除或移动的根级目录。
func (*Layout) PyProjectFile ¶
PyProjectFile 返回受管仓库的项目元数据路径。
func (*Layout) PythonExecutable ¶
PythonExecutable 返回受管 Python 解释器路径。 消费方不得自行拼接 PythonDir() 与文件名:路径知识只能来自本包(AGENTS §4)。
func (*Layout) PythonVersionFile ¶
PythonVersionFile 返回受管仓库的精确 Python 版本文件路径。
func (*Layout) RelayStagingDir ¶ added in v0.1.7
RelayStagingDir 返回回环中继的暂存目录。
它位于下载缓存之下,属于可丢弃缓存:中继在操作期间独占、Close 时清空, cleanup 随 DownloadCacheDir 一并删除,不需要单独分类。
func (*Layout) RepoPreviousDir ¶
RepoPreviousDir 返回本次仓库替换前的保留目录。
func (*Layout) RepoUpdateDir ¶
RepoUpdateDir 返回本次仓库更新操作的暂存目录。
func (*Layout) RepoVersionFile ¶
RepoVersionFile 返回受管仓库版本文件路径。
func (*Layout) RuntimeCacheDir ¶
RuntimeCacheDir 返回 Runtime 缓存根目录。
func (*Layout) RuntimeLogDir ¶
RuntimeLogDir 返回 Runtime 日志目录。
func (*Layout) RuntimeLogFile ¶
RuntimeLogFile 返回指定命令在本地日期的运行日志文件路径。
func (*Layout) UVExecutable ¶
UVExecutable 返回指定 uv 版本的可执行文件路径。
func (*Layout) UVStagingDir ¶
UVStagingDir 返回指定 uv 版本与操作的构建暂存目录。
func (*Layout) UVVersionDir ¶
UVVersionDir 返回指定 uv 版本的工具目录。
func (*Layout) UpdateStateFile ¶
UpdateStateFile 返回更新状态文件路径。
func (*Layout) VenvConfigFile ¶ added in v0.1.5
VenvConfigFile 返回受管项目虚拟环境的 pyvenv.cfg 路径。 CPython 靠它算出 venv 的 home 与 base 解释器:文件缺失时 venv 内的 python.exe 仍在,但一启动就以 `No pyvenv.cfg file` 退出,因此它是判断 venv 是否完整的必检项。
func (*Layout) VenvPythonExecutable ¶
VenvPythonExecutable 返回受管项目虚拟环境的 Python 解释器路径。