artifactcache

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package artifactcache stores completed package files in a local filesystem cache.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

Store is a filesystem-backed artifact acquisition store.

func New

func New(path string, maxBytes int64) (*Store, error)

New creates a filesystem store rooted at path. A zero maxBytes disables the size check when cached content is opened.

func (*Store) Open

func (store *Store) Open(ctx context.Context, request acquire.Request) (*acquire.Entry, error)

Open returns a completed entry matching every populated request field.

func (*Store) Stage

func (store *Store) Stage(
	ctx context.Context,
	request acquire.Request,
	_ acquire.Source,
) (acquire.Stage, error)

Stage creates a private write for unverified package bytes.

func (*Store) Trim

func (store *Store) Trim(maxTotal int64) error

Trim removes the oldest cache entries until the total stored artifact bytes are at or below maxTotal. A maxTotal of zero or less is a no-op. In-progress stages are never removed.

Jump to

Keyboard shortcuts

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