storage

package
v0.0.0-...-c97221a Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Copy

func Copy(source, target string) error

Copy copies a local file or S3 object to another location locally or in S3.

func DownloadArtifacts

func DownloadArtifacts() error

DownloadArtifacts downloads all artifacts from s3 build bucket

func DownloadDockerImages

func DownloadDockerImages() error

DownloadDockerImages fetches image archives from s3 bucket

func MakeBucket

func MakeBucket() error

MakeBucket creates a bucket in s3 for the build (env.BuildNumber)

func RemoveBucket

func RemoveBucket() error

RemoveBucket removes bucket

func Sync

func Sync(source, target string) error

Sync syncs directories and S3 prefixes. Recursively copies new and updated files from the source directory to the destination.

func UploadArtifacts

func UploadArtifacts() error

UploadArtifacts uploads all artifacts to s3 build bucket

func UploadDockerImages

func UploadDockerImages() error

UploadDockerImages uploads all docker images to s3 build bucket

func UploadSingleArtifact

func UploadSingleArtifact(path string) error

UploadSingleArtifact uploads a single file to s3 build bucket

Types

type Storage

type Storage struct {
	*s3.Client
}

Storage wraps AWS S3 client, configures for s3.mysterium.network and provides convenience methods

func NewClient

func NewClient() (*Storage, error)

NewClient returns *s3.Client, configured to work with https://s3.mysterium.network storage

func (*Storage) FindObject

func (s *Storage) FindObject(bucket string, predicate func(types.Object) bool) (*types.Object, error)

FindObject finds an object in storage bucket satisfying given predicate

func (*Storage) GetCacheableFile

func (s *Storage) GetCacheableFile(bucket string, predicate func(types.Object) bool) (string, error)

GetCacheableFile finds a file in a storage bucket satisfying given predicate. If a local copy with the same size does not exist, downloads the file. Otherwise, returns a cached copy.

func (*Storage) ListObjects

func (s *Storage) ListObjects(bucket string) ([]types.Object, error)

ListObjects lists objects in storage bucket

Jump to

Keyboard shortcuts

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