casexistence

package
v1.122.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package casexistence provides a typed cache of the blobs known to exist in a CAS backend, so repeated uploads of the same content skip the backend.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Key

func Key(orgID, backendType, secretID, digest string) string

Key returns the cache key of a digest in the namespace of one organization and one backend. The secret reference is hashed so its path never appears in the shared store.

Types

type Cache

type Cache struct {
	cache.Cache[Entry]
}

Cache wraps cache.Cache[Entry] to provide a distinct type for wire disambiguation.

func New

New creates an existence cache, backed by NATS KV when rc is set and by an in-memory LRU otherwise. A NATS bucket that can not be set up falls back to memory: the cache only makes uploads faster, so it must not stop its caller from starting.

type Entry

type Entry struct {
	Size int64 `json:"size"`
}

Entry is a blob known to exist in a backend.

Jump to

Keyboard shortcuts

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