recent

package
v1.56.0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package recent persists last-used timestamps for named items so a list can offer a "recently used" sort that survives restarts. State is a small JSON map (name to unix seconds), read and written through the file on every call so a fresh process picks up the latest entries. The caller picks the file path, so several independent stores can coexist.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

Store is the file-backed last-used timestamp map. Safe for concurrent use. A zero path disables persistence: every operation becomes a no-op.

func New

func New(path string) *Store

New returns a store backed by path. The file is read on demand, not now.

func (*Store) Times

func (s *Store) Times() map[string]int64

Times returns the last-used timestamps keyed by project name.

func (*Store) Touch

func (s *Store) Touch(name string)

Touch records the current time as the last-used time for the named project, merging into whatever is already on disk.

Jump to

Keyboard shortcuts

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