remote

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2026 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GSUtilCache

type GSUtilCache struct {
	BucketName string
}

GSUtilCache uses the gsutil command to implement a remote cache

func NewGSUtilCache

func NewGSUtilCache(cfg *cache.RemoteConfig) *GSUtilCache

NewGSUtilCache creates a new GSUtil cache implementation

func (*GSUtilCache) Download

func (rs *GSUtilCache) Download(ctx context.Context, dst cache.LocalCache, pkgs []cache.Package) map[string]cache.DownloadResult

Download makes a best-effort attempt at downloading previously cached build artifacts. Returns detailed results for each package to enable smarter retry decisions.

func (*GSUtilCache) ExistingPackages

func (rs *GSUtilCache) ExistingPackages(ctx context.Context, pkgs []cache.Package) (map[cache.Package]struct{}, error)

ExistingPackages returns existing cached build artifacts in the remote cache

func (*GSUtilCache) HasFile added in v0.13.0

func (rs *GSUtilCache) HasFile(ctx context.Context, key string) (bool, error)

HasFile checks if a file exists in the remote cache with the given key

func (*GSUtilCache) Upload

func (rs *GSUtilCache) Upload(ctx context.Context, src cache.LocalCache, pkgs []cache.Package) error

Upload makes a best effort to upload the build artifacts to a remote cache

func (*GSUtilCache) UploadFile added in v0.11.0

func (rs *GSUtilCache) UploadFile(ctx context.Context, filePath string, key string) error

UploadFile uploads a single file to the remote cache with the given key

type NoRemoteCache

type NoRemoteCache struct{}

NoRemoteCache implements the default no-remote cache behavior

func NewNoRemoteCache

func NewNoRemoteCache() *NoRemoteCache

NewNoRemoteCache creates a new NoRemoteCache instance

func (NoRemoteCache) Download

Download makes a best-effort attempt at downloading previously cached build artifacts. NoRemoteCache always returns NotFound for all packages since there is no remote cache.

func (NoRemoteCache) ExistingPackages

func (NoRemoteCache) ExistingPackages(ctx context.Context, pkgs []cache.Package) (map[cache.Package]struct{}, error)

ExistingPackages returns existing cached build artifacts in the remote cache

func (NoRemoteCache) HasFile added in v0.13.0

func (NoRemoteCache) HasFile(ctx context.Context, key string) (bool, error)

HasFile checks if a file exists in the remote cache with the given key

func (NoRemoteCache) Upload

func (NoRemoteCache) Upload(ctx context.Context, src cache.LocalCache, pkgs []cache.Package) error

Upload makes a best effort to upload the build artifacts to a remote cache

func (NoRemoteCache) UploadFile added in v0.11.0

func (NoRemoteCache) UploadFile(ctx context.Context, filePath string, key string) error

UploadFile uploads a single file to the remote cache with the given key

type S3Cache

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

S3Cache implements RemoteCache using AWS S3

func NewS3Cache

func NewS3Cache(cfg *cache.RemoteConfig) (*S3Cache, error)

NewS3Cache creates a new S3 cache implementation

func (*S3Cache) Download

func (s *S3Cache) Download(ctx context.Context, dst cache.LocalCache, pkgs []cache.Package) map[string]cache.DownloadResult

Download implements RemoteCache. Returns detailed results for each package, enabling callers to distinguish between transient failures (retry may help) and permanent failures (rebuild required).

func (*S3Cache) ExistingPackages

func (s *S3Cache) ExistingPackages(ctx context.Context, pkgs []cache.Package) (map[cache.Package]struct{}, error)

ExistingPackages implements RemoteCache

func (*S3Cache) HasFile added in v0.13.0

func (s *S3Cache) HasFile(ctx context.Context, key string) (bool, error)

HasFile checks if a file exists in the remote cache with the given key

func (*S3Cache) Upload

func (s *S3Cache) Upload(ctx context.Context, src cache.LocalCache, pkgs []cache.Package) error

Upload implements RemoteCache

func (*S3Cache) UploadFile added in v0.11.0

func (s *S3Cache) UploadFile(ctx context.Context, filePath string, key string) error

UploadFile uploads a single file to the remote cache with the given key

type S3Config

type S3Config struct {
	BucketName  string
	Region      string
	PartSize    int64
	WorkerCount int
}

S3Config holds the configuration for S3Cache

type S3Storage

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

S3Storage implements ObjectStorage using AWS S3

func NewS3Storage

func NewS3Storage(bucketName string, cfg *aws.Config) *S3Storage

NewS3Storage creates a new S3 storage implementation

func (*S3Storage) GetObject

func (s *S3Storage) GetObject(ctx context.Context, key string, dest string) (int64, error)

GetObject implements ObjectStorage

func (*S3Storage) HasObject

func (s *S3Storage) HasObject(ctx context.Context, key string) (bool, error)

HasObject implements ObjectStorage

func (*S3Storage) ListObjects

func (s *S3Storage) ListObjects(ctx context.Context, prefix string) ([]string, error)

ListObjects implements ObjectStorage

func (*S3Storage) UploadObject

func (s *S3Storage) UploadObject(ctx context.Context, key string, src string) error

UploadObject implements ObjectStorage

func (*S3Storage) ValidateObject added in v0.10.0

func (s *S3Storage) ValidateObject(ctx context.Context, key, localPath string) error

ValidateObject checks if a downloaded object exists and has a valid size

type VerificationFailedError added in v0.13.1

type VerificationFailedError struct {
	Package string
	Reason  string
}

VerificationFailedError is returned when SLSA verification fails

func (VerificationFailedError) Error added in v0.13.1

func (e VerificationFailedError) Error() string

Jump to

Keyboard shortcuts

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