Documentation
¶
Overview ¶
Package statepaths composes cr-specific data and cache paths.
Index ¶
- Constants
- func CacheRoot() (string, error)
- func CacheRootEnsured() (string, error)
- func DataRoot() (string, error)
- func DataRootEnsured() (string, error)
- func Decode(value string) string
- func Encode(value string) string
- func FormatAttempt(attempt int) (string, error)
- func KeyHash(prKey, headSHA, baseSHA, profile, postingIdentity string) string
- func PRKey(host, owner, repo string, number int) (string, error)
- func ResumeScope(profile, postingIdentity string) (string, error)
- type Layout
- type LockSpec
- type RunPaths
- type RunSpec
Constants ¶
const ( // Tool is the binary/tool name used with cli-common statedir resolvers. Tool = "cr" // AppDir is cr's app-specific subdirectory under data/cache roots. AppDir = "codereview" )
Variables ¶
This section is empty.
Functions ¶
func CacheRootEnsured ¶
CacheRootEnsured resolves and creates cr's app cache root.
func DataRootEnsured ¶
DataRootEnsured resolves and creates cr's app data root.
func FormatAttempt ¶
FormatAttempt returns the run attempt path segment. Attempts below 1000 are zero-padded for readability; lexicographic sorting is not guaranteed after that because the design intentionally does not cap attempt numbers at 999.
func ResumeScope ¶
ResumeScope returns the encoded profile/posting-identity path segment.
Types ¶
type Layout ¶
Layout composes paths under resolved cr data/cache roots.
func DefaultLayout ¶
DefaultLayout resolves the current process data/cache layout without creating directories.
func DefaultLayoutEnsured ¶
DefaultLayoutEnsured resolves and creates the current process data/cache app roots.
func (Layout) HTTPCacheDir ¶
HTTPCacheDir returns the disposable git-provider HTTP cache directory.
type LockSpec ¶
type LockSpec struct {
Host string
Owner string
Repo string
PRNumber int
HeadSHA string
BaseSHA string
Profile string
PostingIdentity string
}
LockSpec identifies one review resume key's lock file.