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 Encode(value string) string
- func FormatAttempt(attempt int) (string, error)
- func KeyHash(prKey, headSHA, baseSHA, profile, postingIdentity string) string
- func LegacyCacheRoot(layout Layout) string
- func LegacyDataRoot(layout Layout) string
- func LegacyDataRootExists(layout Layout) (bool, error)
- func MigrateLegacyCacheRoot(layout Layout) error
- func MigrateLegacyDataRoot(layout Layout) error
- 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 the config/credential service directory name. It is retained // for config-scope callers; data/cache roots use Tool directly. AppDir = "codereview" )
Variables ¶
This section is empty.
Functions ¶
func CacheRootEnsured ¶
CacheRootEnsured resolves and creates cr's per-binary cache root.
func DataRootEnsured ¶
DataRootEnsured resolves and creates cr's per-binary 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 LegacyCacheRoot ¶ added in v0.1.40
LegacyCacheRoot returns the historical nested cache root for layout.
func LegacyDataRoot ¶ added in v0.1.40
LegacyDataRoot returns the historical nested data root for layout.
func LegacyDataRootExists ¶ added in v0.1.40
LegacyDataRootExists reports whether layout still has unmigrated legacy data.
func MigrateLegacyCacheRoot ¶ added in v0.1.40
MigrateLegacyCacheRoot moves cache written by releases that nested state under the per-binary root's historical AppDir child.
func MigrateLegacyDataRoot ¶ added in v0.1.40
MigrateLegacyDataRoot moves data written by releases that nested state under the per-binary root's historical AppDir child.
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.