Documentation
¶
Overview ¶
Package appdir discovers the application home directory. Package appdir 发现应用主目录。
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func DiscoverHome ¶
DiscoverHome returns the first candidate directory that matches Markers. DiscoverHome 返回第一个匹配 Markers 的候选目录。
Example / 示例:
home, _ := appdir.DiscoverHome(appdir.Options{EnvVar: "APP_HOME", Markers: []string{"configs"}})
Types ¶
type CandidateSource ¶ added in v0.1.3
type CandidateSource uint8
CandidateSource selects where DiscoverHome searches. CandidateSource 选择 DiscoverHome 的搜索来源。
const ( SourceEnvVar CandidateSource = 1 << iota SourceExecutable SourceWorkingDir )
Click to show internal directories.
Click to hide internal directories.