cache

package
v0.1.83 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: Apache-2.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrOwnerMissing = errors.New("cache owner has no mirror")

ErrOwnerMissing is returned for a binding whose owner no longer has a mirror (it was evicted), so the binding must be discovered again.

Functions

func Remove added in v0.1.72

func Remove(root, key string) error

Remove deletes key's binding, so its next read discovers an owner again.

func Save

func Save(root, key string, binding Binding) (err error)

Save atomically writes key's binding.

Types

type Binding

type Binding struct {
	Version    int    `json:"version"`
	Owner      string `json:"owner"`
	Repository string `json:"repository,omitempty"`
}

Binding is <root>/<key>/repository.json: the cache key whose mirror holds key's objects, and the (redacted) URL of the repository key caches. Bindings written before Repository was recorded leave it empty.

func Load

func Load(root, key string) (Binding, error)

Load reads key's binding; a key without one owns its mirror.

Jump to

Keyboard shortcuts

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