cache

package
v0.1.76 Latest Latest
Warning

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

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

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