Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CacheRepository ¶
type CacheRepository interface {
// Push stores the given data bytes under the specified reference key.
// The reference typically matches an OCI artifact reference or URL.
Push(ctx context.Context, reference string, data []byte) error
// Pull retrieves a cached artifact by reference and returns the
// local filesystem path where the data is stored.
Pull(ctx context.Context, reference string) (string, error)
}
CacheRepository defines the interface for caching Makefile artifacts. Implementations may store artifacts locally, over HTTP, or in OCI registries.
func NewCache ¶
func NewCache(cfg *config.Config, reference string) CacheRepository
NewCache constructs a CacheRepository based on the reference type. It inspects the reference string and returns an HTTP-based cache or an OCI repository-based cache. Returns nil for unsupported types.
func NewHTTPCache ¶
func NewHTTPCache(cfg *config.Config) CacheRepository
NewHTTPCache returns a new HTTPCache configured with the given settings.
func NewOCIRepository ¶
func NewOCIRepository(cfg *config.Config) CacheRepository
NewOCIRepository returns a new OCIRepository using the provided configuration.
type HTTPCache ¶
type HTTPCache struct {
// contains filtered or unexported fields
}
HTTPCache implements CacheRepository for HTTP(S) references. It stores blobs under a directory structure based on the URL host and path, using SHA-256 digests for content addressing and symbolic links for references.
func (*HTTPCache) Pull ¶
Pull retrieves the cached path for the given reference URL. It reads the 'latest' symlink under 'cacheDir/host/.../refs' and returns its target. Returns an error if the cache entry does not exist or is invalid.
type OCIRepository ¶
type OCIRepository struct {
// contains filtered or unexported fields
}
OCIRepository implements CacheRepository for OCI artifact references. It stores blobs under a directory structure based on registry and repository, uses SHA-256 digests for content addressing, and symlinks tags and digests under refs.
func (*OCIRepository) Pull ¶
Pull retrieves a cached artifact path for the given OCI reference. It looks for a symlink under 'refs/<identifier>' first. If missing and the reference is a digest, it checks the blob directly. Returns an error on cache miss.