Documentation
¶
Overview ¶
Package cache provides a filesystem-backed XDG cache for per-commit analysis artifacts.
Index ¶
- type Cache
- func (c *Cache) Get(repoID, sha string) ([]analyzer.LanguageMetricsSummary, error)
- func (c *Cache) Has(repoID, sha string) bool
- func (c *Cache) Path(repoID, sha string) string
- func (c *Cache) Put(repoID, sha string, metrics []analyzer.LanguageMetricsSummary) error
- func (c *Cache) WorkspacePath(repoID string) string
- type Config
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 ¶
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) 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 ¶
WorkspacePath returns the path to the workspace directory for a given repo.
Click to show internal directories.
Click to hide internal directories.