cache

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const CacheDirHelp = "Cache directory (default: $XDG_CACHE_HOME/complypack or $HOME/.cache/complypack)"

CacheDirHelp is the user-facing description for --cache-dir flag help text.

Variables

This section is empty.

Functions

func Clean

func Clean(cacheDir string) error

Clean removes all contents of the cache directory while preserving the directory itself. This avoids invalidating the directory inode, which could cause issues for other processes that hold a reference to it. If the directory does not exist, Clean returns nil (not an error).

func NewOCIStore

func NewOCIStore(cacheDir string) (*oci.Store, error)

NewOCIStore creates or opens an OCI Image Layout store at the given directory. The directory and all parents are created with 0750 permissions if they do not already exist.

func ResolveDir

func ResolveDir(explicit string) (string, error)

ResolveDir resolves the cache directory using the following priority:

  1. explicit flag value (if non-empty)
  2. $XDG_CACHE_HOME/complypack (if XDG_CACHE_HOME is set and non-empty)
  3. $HOME/.cache/complypack (per XDG Base Directory Specification fallback)

Returns an error if neither HOME nor XDG_CACHE_HOME is set and no explicit value is provided.

Types

This section is empty.

Jump to

Keyboard shortcuts

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