store

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: May 25, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package store reads and writes the plain-text PR list files used by prowl. Format is one PR URL per line; blank lines and lines beginning with `#` are ignored. A historical "<tag>|<url>" line format is also tolerated for reads.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadURLs

func ReadURLs(path string) ([]string, error)

ReadURLs parses a list file and returns the URLs in document order.

Types

type Store

type Store struct {
	ActivePath   string
	ReviewedPath string
}

Store is a pair of plain-text files: an active list and a reviewed list.

func New

func New(active, reviewed string) (*Store, error)

New constructs a Store and ensures both files exist. It also migrates pre-existing legacy files (prs-unmerged.txt, prs-merged.txt, prs-closed.txt) into the new active/reviewed layout.

func (*Store) Active

func (s *Store) Active() ([]string, error)

Active returns the URLs stored in the active list (in file order).

func (*Store) Add

func (s *Store) Add(url string) (bool, error)

Add appends a URL to the active list. Returns false if the URL is already tracked in either list.

func (*Store) MoveActiveToReviewed

func (s *Store) MoveActiveToReviewed(urls []string) (int, error)

MoveActiveToReviewed moves the given URLs from the active list to the reviewed list, preserving line order. URLs that aren't present in active are silently ignored.

func (*Store) Remove

func (s *Store) Remove(url string) (int, error)

Remove deletes the URL from both lists. Returns the number of removed rows.

func (*Store) Reviewed

func (s *Store) Reviewed() ([]string, error)

Reviewed returns the URLs stored in the reviewed list (in file order).

Jump to

Keyboard shortcuts

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