cache

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheData added in v0.2.0

type CacheData struct {
	Repos     []model.Repo `json:"repos"`
	Timestamp time.Time    `json:"timestamp"`
	Roots     []string     `json:"roots"`
}

CacheData represents the cached scan results

type FileStore added in v0.2.0

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

FileStore implements Store using a JSON file

func NewFileStore added in v0.2.0

func NewFileStore() *FileStore

NewFileStore creates a new file-based cache store

func (*FileStore) Clear added in v0.2.0

func (s *FileStore) Clear() error

Clear removes the cache file

func (*FileStore) GetTimestamp added in v0.2.0

func (s *FileStore) GetTimestamp() time.Time

GetTimestamp returns the cache timestamp

func (*FileStore) IsSameRoots added in v0.2.0

func (s *FileStore) IsSameRoots(roots []string) bool

IsSameRoots checks if cached roots match current roots

func (*FileStore) IsValid added in v0.2.0

func (s *FileStore) IsValid(maxAge time.Duration) bool

IsValid checks if cache is still valid based on max age

func (*FileStore) Load added in v0.2.0

func (s *FileStore) Load() (*CacheData, error)

Load reads cached data from disk

func (*FileStore) Save added in v0.2.0

func (s *FileStore) Save(repos []model.Repo, roots []string) error

Save writes repos to cache file

type Store

type Store interface {
	Load() (*CacheData, error)
	Save(repos []model.Repo, roots []string) error
	IsValid(maxAge time.Duration) bool
}

Store interface for caching repo data

Jump to

Keyboard shortcuts

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