persistence

package
v0.0.0-...-b74b5fa Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package persistence provides storage for review sessions.

Index

Constants

This section is empty.

Variables

View Source
var ErrSessionNotFound = errors.New("session not found")

ErrSessionNotFound is returned by LoadLatest when no matching session exists.

Functions

This section is empty.

Types

type FileStore

type FileStore struct {
	// contains filtered or unexported fields
}

FileStore implements Store by persisting sessions as JSON files on disk.

func NewFileStore

func NewFileStore(log *slog.Logger) (*FileStore, error)

NewFileStore creates a FileStore using the default session directory.

func (*FileStore) LoadLatest

func (fs *FileStore) LoadLatest(repoPath, branchName string, diffSource model.DiffSource) (*model.ReviewSession, error)

LoadLatest finds and loads the most recent session matching the given context.

func (*FileStore) Save

func (fs *FileStore) Save(session *model.ReviewSession) (string, error)

Save writes the session to disk.

type Store

type Store interface {
	Save(session *model.ReviewSession) (string, error)
	LoadLatest(repoPath, branchName string, diffSource model.DiffSource) (*model.ReviewSession, error)
}

Store defines the interface for session persistence.

Jump to

Keyboard shortcuts

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