cache

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package cache is the content-addressed cache of fetched source material, enabling offline reproduction from a warm cache.

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 is the content-addressed cache of fetched source material, keyed by an immutable fetch key (typically a commit SHA). A warm cache enables offline reproduction (FR-025, FR-026).

func New

func New(root string) *Cache

New returns a Cache rooted at root.

func (*Cache) Has

func (c *Cache) Has(key string) bool

Has reports whether material for key is cached.

func (*Cache) Path

func (c *Cache) Path(key string) string

Path returns the directory for a fetch key, whether or not it exists.

func (*Cache) Put

func (c *Cache) Put(key, srcDir string) (string, error)

Put imports fetched material from srcDir under key and returns the cached path. It is idempotent, so a warm entry is reused rather than refetched.

func (*Cache) Root

func (c *Cache) Root() string

Root returns the cache's root directory.

Jump to

Keyboard shortcuts

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