paths

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: Apache-2.0, BSD-3-Clause, CC-BY-4.0, + 2 more Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package paths 定义本机私有状态的路径命名空间与最小权限要求。 它不包含 Pixiv 协议、MCP 传输或业务配置解析。

Index

Constants

View Source
const (
	// AppDataDirName 是本项目所有本机持久状态的唯一根目录名。
	AppDataDirName  = ".pixiv-cli"
	PrivateDirMode  = 0o700
	PrivateFileMode = 0o600
)

Variables

This section is empty.

Functions

func AppDataDir

func AppDataDir() (string, error)

AppDataDir 返回本项目当前用户的私有应用数据根目录。

func ConfigFilePath

func ConfigFilePath() (string, error)

ConfigFilePath 返回 config.toml 的应用管理路径。配置 schema 由 internal/config/settings 拥有;本机路径与权限只由本包解析。

func SetConfigFilePathForTest

func SetConfigFilePathForTest(path string) func()

SetConfigFilePathForTest 为依赖默认 app path 的进程测试提供可恢复的路径 注入。生产代码不调用它;恢复函数必须在测试清理阶段执行。

func UserDataFile

func UserDataFile(appName, filename string) (string, error)

UserDataFile 返回应用数据目录内的指定文件路径。

func UserDataSubdir

func UserDataSubdir(appName string) (string, error)

UserDataSubdir 返回当前用户 home 下的应用数据目录。所有平台均使用相同的 `~/APP_NAME` 语义;Windows 上的 home 由 os.UserHomeDir 解析为用户 profile。

Types

This section is empty.

Jump to

Keyboard shortcuts

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