store

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package store locates live-pr's user-level runtime data for one repo + branch.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MigrateLegacy

func MigrateLegacy(root string) error

MigrateLegacy moves data from the old repository-local .live-pr/ layout. Legacy config.toml is renamed to .live-pr.toml when possible; the old path remains readable through config.Load if migration cannot move it.

func NavigatorCache(root string) string

NavigatorCache is the repository-wide PR list and remote snapshot cache.

func PullRequestReviewDraft added in v0.2.0

func PullRequestReviewDraft(root string, number int) string

PullRequestReviewDraft is an unpublished review isolated by pull-request number.

Types

type Store

type Store struct {
	Root   string // repo top level
	Branch string // current branch
	Dir    string // user-level state directory for this repo + branch
}

Layout lives outside the repository:

$XDG_STATE_HOME/live-pr/repos/<repo>/<branch>/
  timeline.jsonl
  conclusion.md

The repository path is hashed so two repositories with the same directory name cannot share state.

func Discover

func Discover() (*Store, error)

Discover resolves the store for the current repo and branch, creating the per-branch directory if needed.

func ForBranch

func ForBranch(root, branch string) *Store

ForBranch resolves branch paths without creating files or directories.

func (*Store) Conclusion

func (s *Store) Conclusion() string

Conclusion is the path to the pinned current conclusion.

func (*Store) Ensure

func (s *Store) Ensure() error

Ensure creates the branch data directory.

func (*Store) GitHubCache

func (s *Store) GitHubCache() string

GitHubCache is the path to mutable remote state kept separate from the timeline.

func (*Store) HasData

func (s *Store) HasData() bool

HasData reports whether a branch has meaningful local PR content.

func (*Store) Timeline

func (s *Store) Timeline() string

Timeline is the path to the append-only local event log.

func (*Store) WriteConclusion

func (s *Store) WriteConclusion(body string) error

WriteConclusion atomically replaces the final pull-request summary.

Jump to

Keyboard shortcuts

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