cache

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package cache provides cache-related operations.

Index

Constants

View Source
const SchemaFileName = "schema.json"

SchemaFileName is the name of the cache schema version file stored at the root of the cache directory.

View Source
const SchemaVersion = 1

SchemaVersion is the current cache directory schema version.

View Source
const TagListFileName = "releases.json"

TagListFileName is the name of the cached release tag list file stored at the root of the cache directory.

Variables

This section is empty.

Functions

func EnsureSchema added in v0.14.0

func EnsureSchema(cacheDirPath, defaultDirName string) (int, error)

EnsureSchema verifies that the cache schema file exists and matches the current schema version. If not, all versioned cache directories (except defaultDirName) are removed and a new schema file is written. Returns the number of directories removed; 0 means the schema was already current or the cache contained no versioned directories.

func ExecName

func ExecName() string

ExecName returns the name of the executable file based on the OS.

func Size

func Size(cachePath, excludeDir string) (int64, error)

Size returns the size of the cache directory, in bytes, excluding the specified exclude directory.

Types

type Schema added in v0.14.0

type Schema struct {
	SchemaVersion int `json:"schemaVersion"`
}

Schema represents the cache schema version file stored at the root of the cache directory.

Jump to

Keyboard shortcuts

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