cache

package
v0.0.0-...-54ed9d2 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package cache provides content-addressable build artifact caching for Helix Cluster OS.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Digest

func Digest(data []byte) string

Digest computes the SHA-256 digest of data.

Types

type Cache

type Cache interface {
	Put(digest string, data []byte) error
	Get(digest string) ([]byte, error)
	Has(digest string) bool
	Delete(digest string) error
}

Cache is a content-addressable storage cache for build artifacts.

type DiskCache

type DiskCache struct {
	// contains filtered or unexported fields
}

DiskCache is a filesystem-backed Cache implementation.

func NewDiskCache

func NewDiskCache(root string) (*DiskCache, error)

NewDiskCache creates a new DiskCache rooted at the given directory.

func (*DiskCache) Delete

func (c *DiskCache) Delete(digest string) error

Delete removes a digest.

func (*DiskCache) Get

func (c *DiskCache) Get(digest string) ([]byte, error)

Get retrieves data by digest.

func (*DiskCache) Has

func (c *DiskCache) Has(digest string) bool

Has checks if a digest exists.

func (*DiskCache) Put

func (c *DiskCache) Put(digest string, data []byte) error

Put stores data under the given digest.

type MemoryCache

type MemoryCache struct {
	// contains filtered or unexported fields
}

MemoryCache is an in-memory Cache implementation.

func NewMemoryCache

func NewMemoryCache() *MemoryCache

NewMemoryCache creates a new MemoryCache.

func (*MemoryCache) Delete

func (c *MemoryCache) Delete(digest string) error

Delete removes a digest.

func (*MemoryCache) Get

func (c *MemoryCache) Get(digest string) ([]byte, error)

Get retrieves data by digest.

func (*MemoryCache) Has

func (c *MemoryCache) Has(digest string) bool

Has checks if a digest exists.

func (*MemoryCache) Put

func (c *MemoryCache) Put(digest string, data []byte) error

Put stores data under the given digest.

Jump to

Keyboard shortcuts

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