local

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2025 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Overview

Package local provides local Go build cache.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DiskInfo

func DiskInfo(dir string) (total, free int64, err error)

DiskInfo returns the total and free disk space in bytes.

Types

type Cache

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

Cache represents a local Go build cache, compatible with a built-in one. It provides more configuration options for trimming.

func New

func New(dir string, cutoff *time.Time, maxSize *int64, l *slog.Logger) (*Cache, error)

New creates a new Cache.

func (*Cache) Close

func (c *Cache) Close() error

Close implements cache.Cache.

func (*Cache) FuzzDir

func (c *Cache) FuzzDir() string

FuzzDir implements cache.Cache.

func (*Cache) Get

func (c *Cache) Get(id cache.ActionID) (cache.Entry, error)

Get implements cache.Cache.

func (*Cache) OutputFile

func (c *Cache) OutputFile(id cache.OutputID) string

OutputFile implements cache.Cache.

func (*Cache) Put

func (c *Cache) Put(id cache.ActionID, rs io.ReadSeeker) (cache.OutputID, int64, error)

Put implements cache.Cache.

func (*Cache) TrimForce

func (c *Cache) TrimForce() (before, freed int64)

TrimForce removes cache entries (starting from least recently used), enforcing both cutoff date and max cache size, if set. It ignores the last trim time, but updates it.

Jump to

Keyboard shortcuts

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