modcache

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SplitPathVersion

func SplitPathVersion(pathVersion string) (path, version string, err error)

SplitPathVersion splits a path@version into path & version

Types

type Cache

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

func Default

func Default() *Cache

Default loads a module cache from the default location

func New

func New(cacheDir string) *Cache

New module cache relative to the cache directory

func (*Cache) Directory

func (c *Cache) Directory(subpaths ...string) string

Directory returns the cache directory joined with optional subpaths

func (*Cache) ResolveDirectory

func (c *Cache) ResolveDirectory(modulePath, version string) (string, error)

ResolveDirectory returns the directory to which m should have been downloaded. An error will be returned if the module path or version cannot be escaped. An error satisfying errors.Is(err, os.ErrNotExist) will be returned along with the directory if the directory does not exist or if the directory is not completely populated.

Jump to

Keyboard shortcuts

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