...

Package modcache

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

Overview ▾

Package modcache provides a file-based cache for modules.

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

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.

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.