buildcache

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2025 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// CreateDirErr error occurred when creating the cache directory
	CreateDirErr = cacheError{Code: createDirErrCode}
	// FileWriteErr error occurred when writing the placeholder file
	FileWriteErr = cacheError{Code: fileWriteErrCode}
)

Functions

This section is empty.

Types

type BuildCache

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

BuildCache represents a cache of built files (sketches and cores), it's designed to work on directories. Given a directory as "base" it handles direct subdirectories as keys

func New

func New(baseDir *paths.Path) *BuildCache

New instantiates a build cache

func (*BuildCache) GetOrCreate

func (bc *BuildCache) GetOrCreate(key string) (*paths.Path, error)

GetOrCreate retrieves or creates the cache directory at the given path If the cache already exists the lifetime of the cache is extended.

func (*BuildCache) Purge

func (bc *BuildCache) Purge(ttl time.Duration)

Purge removes all cache directories within baseDir that have expired To know how long ago a directory has been last used it checks into the .last-used file.

Jump to

Keyboard shortcuts

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

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy