Documentation
¶
Overview ¶
Package prcache provides PR status caching stored in ~/.wt/prs.json. PRs are stored independently of worktree entries, keyed by repoPath:branch, allowing PR info to be cached before worktrees are created.
Index ¶
Constants ¶
View Source
const CacheMaxAge = 24 * time.Hour
CacheMaxAge is the maximum age of cached PR info before it's considered stale
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Cache ¶
Cache stores PR info keyed by repoPath:branch
func Load ¶
func Load() *Cache
Load loads the PR cache from disk. Returns an empty cache if the file is missing or corrupted.
func (*Cache) SaveIfDirty ¶ added in v0.17.0
SaveIfDirty saves the cache to disk only if it has been modified. Resets the dirty flag after a successful save.
type PRInfo ¶
type PRInfo struct {
Number int `json:"number"`
State string `json:"state"` // Normalized: OPEN, MERGED, CLOSED
IsDraft bool `json:"is_draft"` // true if PR is a draft
URL string `json:"url"`
Author string `json:"author"` // username/login
CommentCount int `json:"comment_count"` // number of comments
HasReviews bool `json:"has_reviews"` // any reviews submitted
IsApproved bool `json:"is_approved"` // approved status
CachedAt time.Time `json:"cached_at"`
Fetched bool `json:"fetched"` // true = API was queried (distinguishes "not fetched" from "no PR")
}
PRInfo represents pull request information
Click to show internal directories.
Click to hide internal directories.