{"modulePath":"github.com/chainloop-dev/chainloop","version":"v1.138.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package casexistence\n\nPackage 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.\n\n## Functions\n\n```go\nfunc Key(orgID, backendType, secretID, digest string) string\n```\nKey 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.\n\n## Types\n\n```go\ntype Cache struct {\n\tcache.Cache[Entry]\n}\n```\nCache wraps cache.Cache\\[Entry] to provide a distinct type for wire disambiguation.\n\n```go\nfunc New(ctx context.Context, rc *natsconn.ReloadableConnection, logger log.Logger) (*Cache, error)\n```\nNew 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.\n\n```go\ntype Entry struct {\n\tSize int64 `json:\"size\"`\n}\n```\nEntry is a blob known to exist in a backend.\n\n","path":"github.com/chainloop-dev/chainloop/pkg/cache/casexistence","name":"casexistence","synopsis":"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.","isRedistributable":true}
