gocuelang.org/go/mod/modcache Index | Files

package modcache

import "cuelang.org/go/mod/modcache"

Package modcache provides a file-based cache for modules.

WARNING: THIS PACKAGE IS EXPERIMENTAL. ITS API MAY CHANGE AT ANY TIME.

Index

Functions

func New

func New(registry *modregistry.Client, dir string) (modload.Registry, error)

New returns r wrapped inside a caching layer that stores persistent cached content inside the given OS directory, typically ${CUE_CACHE_DIR}.

The `module.SourceLoc.FS` fields in the locations returned by the registry implement the `OSRootFS` interface, allowing a caller to find the native OS filepath where modules are stored.

func RemoveAll

func RemoveAll(dir string) error

RemoveAll removes a directory written by the cache, first applying any permission changes needed to do so.

Source Files

cache.go fetch.go

Version
v0.12.0 (latest)
Published
Jan 30, 2025
Platform
linux/amd64
Imports
19 packages
Last checked
8 hours ago

Tools for package owners.