cache

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HashPackages

func HashPackages(packages []string) string

HashPackages creates a cache key from a list of packages

Types

type Cache

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

Cache manages the buns cache directory

func Default

func Default() (*Cache, error)

Default returns a cache using the default directory (~/.buns)

func New

func New(baseDir string) *Cache

New creates a new cache manager

func (*Cache) BaseDir

func (c *Cache) BaseDir() string

BaseDir returns the base cache directory

func (*Cache) BunDir

func (c *Cache) BunDir() string

BunDir returns the directory for Bun binaries

func (*Cache) CleanAll

func (c *Cache) CleanAll() error

CleanAll removes the entire cache

func (*Cache) CleanBun

func (c *Cache) CleanBun() error

CleanBun removes all cached Bun binaries

func (*Cache) CleanDeps

func (c *Cache) CleanDeps() error

CleanDeps removes all cached dependencies

func (*Cache) CleanIndex

func (c *Cache) CleanIndex() error

CleanIndex removes the cached index

func (*Cache) DepsDir

func (c *Cache) DepsDir() string

DepsDir returns the directory for script dependencies

func (*Cache) DepsDirForHash

func (c *Cache) DepsDirForHash(hash string) string

DepsDirForHash returns the directory for a specific dependency hash

func (*Cache) EnsureDirs

func (c *Cache) EnsureDirs() error

EnsureDirs creates all necessary cache directories

func (*Cache) IndexDir

func (c *Cache) IndexDir() string

IndexDir returns the directory for cached index data

func (*Cache) IsDepsHit

func (c *Cache) IsDepsHit(hash string) bool

IsDepsHit checks if dependencies are cached for the given hash

func (*Cache) ListBunVersions

func (c *Cache) ListBunVersions() ([]string, error)

ListBunVersions returns all cached Bun versions

func (*Cache) ListDepsHashes

func (c *Cache) ListDepsHashes() ([]string, error)

ListDepsHashes returns all cached dependency hashes

func (*Cache) Size

func (c *Cache) Size() (int64, error)

Size returns the total size of the cache in bytes

Jump to

Keyboard shortcuts

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