remote

package
v0.9.5 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2025 License: MIT Imports: 18 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) error

Download makes a best-effort attempt at downloading previously cached build artifacts

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) 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

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

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

Download makes a best-effort attempt at downloading previously cached build artifacts

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) 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

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) error

Download implements RemoteCache

func (*S3Cache) ExistingPackages

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

ExistingPackages implements RemoteCache

func (*S3Cache) Upload

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

Upload implements RemoteCache

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

Jump to

Keyboard shortcuts

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