Help us shape the future of Go! Take the 2026 Go Developer Survey

cache

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2026 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package cache provides a filesystem-backed XDG cache for per-commit analysis artifacts.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

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

Cache manages the metrics cache.

func NewCache

func NewCache(cfg Config) *Cache

NewCache creates a new cache with the given configuration. If BaseDir is empty, it defaults to $HOME/.cache/uda.

func (*Cache) Get

func (c *Cache) Get(repoID, sha string) ([]analyzer.LanguageMetricsSummary, error)

Get retrieves cached metrics for the given repo and commit. Returns an error if the cache entry does not exist.

func (*Cache) Has

func (c *Cache) Has(repoID, sha string) bool

Has returns true if the cache contains metrics for the given repo and commit.

func (*Cache) Path

func (c *Cache) Path(repoID, sha string) string

Path returns the path to the cached metrics file for a given repo and commit.

func (*Cache) Put

func (c *Cache) Put(repoID, sha string, metrics []analyzer.LanguageMetricsSummary) error

Put stores metrics in the cache for the given repo and commit.

func (*Cache) WorkspacePath

func (c *Cache) WorkspacePath(repoID string) string

WorkspacePath returns the path to the workspace directory for a given repo.

type Config

type Config struct {
	BaseDir string // Default: $HOME/.cache/uda
}

Config holds cache configuration.

Jump to

Keyboard shortcuts

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