Help us shape the future of Go! Take the 2026 Go Developer Survey

packagecache

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const GlobalVolumePrefix = "crib-cache-"

GlobalVolumePrefix is the prefix shared by all crib cache volumes.

Variables

This section is empty.

Functions

func BuildCacheMounts

func BuildCacheMounts(providers []string) []string

BuildCacheMounts returns cache mount target paths for use during image builds. Feature install scripts run as root, so home-relative paths use /root. For apt, both /var/cache/apt and /var/lib/apt/lists are included.

func ParseVolumeName added in v0.8.0

func ParseVolumeName(name string) (workspaceID, provider string)

ParseVolumeName extracts workspace ID and provider from a cache volume name. Volume names follow the pattern "crib-cache-{wsID}-{provider}", but compose workspaces may have a "{project}_" prefix (e.g. "crib-web_crib-cache-web-apt"). All provider names are single words (no hyphens), so the provider is the segment after the last hyphen in the suffix after "crib-cache-".

func SupportedProviders

func SupportedProviders() []string

SupportedProviders returns the list of known cache provider names.

func ValidateProviders

func ValidateProviders(providers []string) []string

ValidateProviders returns provider names that are not recognized.

func VolumeName

func VolumeName(workspaceID, provider string) string

VolumeName returns the Docker volume name for a workspace's cache provider.

func VolumePrefix

func VolumePrefix(workspaceID string) string

VolumePrefix returns the volume name prefix for a workspace's cache volumes.

Types

type Plugin

type Plugin struct {
	plugin.BasePlugin
	// contains filtered or unexported fields
}

Plugin shares host package caches via named Docker volumes.

func New

func New(providers []string) *Plugin

New creates a package cache plugin for the given providers. Unknown providers are skipped at runtime. Use ValidateProviders to check for unknown names before creating the plugin.

func (*Plugin) Name

func (p *Plugin) Name() string

Name returns the plugin identifier.

func (*Plugin) PreContainerRun

PreContainerRun returns volume mounts for each configured cache provider.

Jump to

Keyboard shortcuts

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