cache

package
v1.16.3 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2024 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

View Source
const (
	HashInvalid = "?"
	HashSkip    = ""
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Impl

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

Impl represents a cache.

func New

func New(h PkgHash) *Impl

New creates a new cache.

func (*Impl) Find

func (p *Impl) Find(dir, pkgPath string) (f io.ReadCloser, err error)

Find finds the cache for a pkgPath.

func (*Impl) ListTimes

func (p *Impl) ListTimes() int

ListTimes returns the number of times of calling `go list`.

func (*Impl) Load

func (p *Impl) Load(cacheFile string) (err error)

Load loads the cache from a file.

func (*Impl) Prepare

func (p *Impl) Prepare(dir string, pkgPath ...string) (err error)

Prepare prepares the cache for a list of pkgPath.

func (*Impl) Save

func (p *Impl) Save(cacheFile string) (err error)

Save saves the cache to a file.

type PkgHash

type PkgHash func(pkgPath string, self bool) (hash string)

PkgHash represents a package hash function.

Jump to

Keyboard shortcuts

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