cache

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2026 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package cache provides an interface for caching boot assets.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoRedirect is returned when the cache does not support redirects.
	ErrNoRedirect = errors.New("redirects are not supported")

	// ErrCacheNotFound is returned when the requested asset is not found in the cache.
	ErrCacheNotFound = errors.New("not found in cache")

	// ErrNoReader is returned when the asset does not provide a reader.
	ErrNoReader = errors.New("asset does not provide a reader")
)

Functions

This section is empty.

Types

type BootAsset

type BootAsset interface {
	Size() int64
	Reader() (io.ReadCloser, error)
}

BootAsset is an interface to access a boot asset.

It is used to abstract the access to the boot asset, so that it can be implemented in different ways, such as a local file, a remote file.

type Cache

type Cache interface {
	Get(ctx context.Context, profileID string) (BootAsset, error)
	Put(ctx context.Context, profileID string, asset BootAsset, filename string) error
}

Cache is an interface for a cache that stores boot assets.

type RedirectableAsset

type RedirectableAsset interface {
	BootAsset
	Redirect(ctx context.Context, filename string) (string, error)
}

RedirectableAsset is an interface for a boot asset that supports redirects.

Directories

Path Synopsis
Package cdn implements a cache wrapper for boot assets, rewriting URLs to go through CDN.
Package cdn implements a cache wrapper for boot assets, rewriting URLs to go through CDN.
Package registry implements a cache using an OCI registry.
Package registry implements a cache using an OCI registry.
Package s3 implements a cache for boot assets using S3-compatible storage.
Package s3 implements a cache for boot assets using S3-compatible storage.

Jump to

Keyboard shortcuts

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