cache

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clear

func Clear(gemfileLockPath string) error

Clear removes the cache entry for a given Gemfile.lock

func GetCacheDir

func GetCacheDir() (string, error)

GetCacheDir returns the cache directory path

func GetCachePath

func GetCachePath(gemfileLockPath string) (string, error)

GetCachePath returns the cache file path for a given Gemfile.lock

func Write

func Write(gemfileLockPath string, entry *CacheEntry) error

Write writes analysis result to cache

func WriteHealth added in v1.1.0

func WriteHealth(gemfileLockPath string, entry *HealthCacheEntry) error

WriteHealth writes health data to cache

Types

type CacheEntry

type CacheEntry struct {
	Result            *gemfile.AnalysisResult `json:"result"`
	GemfileLockMtime  int64                   `json:"gemfile_lock_mtime"`
	CachedAt          time.Time               `json:"cached_at"`
	RubyVersion       string                  `json:"ruby_version"`
	BundleVersion     string                  `json:"bundle_version"`
	FrameworkDetected string                  `json:"framework_detected"`
	RailsVersion      string                  `json:"rails_version"`
}

CacheEntry represents a cached analysis result with metadata

func Read

func Read(gemfileLockPath string) (*CacheEntry, error)

Read reads cached analysis result if it exists and is valid

type HealthCacheEntry added in v1.1.0

type HealthCacheEntry struct {
	Gems     map[string]*gemfile.GemHealth `json:"gems"`
	CachedAt time.Time                     `json:"cached_at"`
}

HealthCacheEntry stores gem health data with a 24-hour TTL

func ReadHealth added in v1.1.0

func ReadHealth(gemfileLockPath string) (*HealthCacheEntry, error)

ReadHealth reads health cache for a Gemfile.lock if it exists and is less than 24 hours old

Jump to

Keyboard shortcuts

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