source

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package source abstracts where ccsession reads sessions from, so a second backend can be added without changing the list/preview/resume wiring.

Index

Constants

View Source
const EnvVar = "CCSESSION_SOURCE"

EnvVar selects the backend and is inherited by the fzf subprocesses via os.Environ() (see cmd/ccsession/main.go), so every re-invocation resolves the same source.

Variables

This section is empty.

Functions

func Names

func Names() []string

Names lists the valid backend names (excluding the empty default).

func Preflight

func Preflight() error

Preflight validates the selected backend before the TUI launches; errors raised inside fzf are invisible. Only opencode has a failure mode worth catching early (missing/legacy/unreadable DB); claude is always ready.

func ValidName

func ValidName(name string) bool

ValidName reports whether name selects a known backend; the empty string is valid and means the claude default.

Types

type Source

type Source interface {
	Name() string
	Scan() ([]*session.Session, error)
	ScanFiltered(allow map[string]struct{}) ([]*session.Session, error)
	FindByID(id string) (*session.Session, error)
	GrepKeys(query string, regex bool) (map[string]struct{}, error)
	ResumeSpec(s *session.Session) (bin string, args []string, err error)
}

func FromEnv

func FromEnv() (Source, error)

Jump to

Keyboard shortcuts

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