pkgcache

package
v1.46.1 Latest Latest
Warning

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

Go to latest
Published: May 12, 2022 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrMissing = errors.New("missing data")

Functions

This section is empty.

Types

type Cache

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

Cache is a per-package data cache. A cached data is invalidated when package, or it's dependencies change.

func NewCache

func NewCache(sw *timeutils.Stopwatch, log logutils.Log) (*Cache, error)

func (*Cache) Get

func (c *Cache) Get(pkg *packages.Package, mode HashMode, key string, data interface{}) error

func (*Cache) Put

func (c *Cache) Put(pkg *packages.Package, mode HashMode, key string, data interface{}) error

func (*Cache) Trim

func (c *Cache) Trim()

type HashMode added in v1.21.0

type HashMode int
const (
	HashModeNeedOnlySelf HashMode = iota
	HashModeNeedDirectDeps
	HashModeNeedAllDeps
)

Jump to

Keyboard shortcuts

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