artifacts

package
v1.19.5 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2026 License: MIT Imports: 22 Imported by: 1

Documentation

Index

Constants

View Source
const EmbeddedLocatorString = "embedded"

Variables

View Source
var DefaultL1ContractsLocator = EmbeddedLocator
View Source
var DefaultL2ContractsLocator = EmbeddedLocator
View Source
var EmbeddedLocator = &Locator{
	URL: embeddedURL,
}
View Source
var ErrUnsupportedArtifactsScheme = errors.New("unsupported artifacts URL scheme")

Functions

func CleanupAll

func CleanupAll() error

CleanupAll performs cleanup of all registered temporary directories

func ContentDigest added in v1.19.5

func ContentDigest(bundle fs.FS) (common.Hash, error)

ContentDigest commits to every file path and file content in an artifact bundle. Filesystem metadata and empty directories are ignored so equivalent extractions hash identically.

func CreateHttpLocator

func CreateHttpLocator(contentHash string) string

func Download

func Download(ctx context.Context, loc *Locator, progressor ioutil.Progressor, targetDir string) (foundry.StatDirFs, error)

func ExtractEmbedded

func ExtractEmbedded(destDir string) (foundry.StatDirFs, error)

func ExtractFromFile

func ExtractFromFile(destDir string, tarFilePath string) (foundry.StatDirFs, error)

func GetCleanupDirs

func GetCleanupDirs() []string

GetCleanupDirs returns a copy of currently registered cleanup directories

func RegisterForCleanup

func RegisterForCleanup(dirPath string)

RegisterForCleanup registers a directory for cleanup

Types

type Bundle added in v1.19.5

type Bundle struct {
	L1 foundry.StatDirFs
	L2 foundry.StatDirFs
}

Bundle keeps the L1 and L2 contract artifacts selected for one deployment together.

func DownloadBundle added in v1.19.5

func DownloadBundle(
	ctx context.Context,
	l1, l2 *Locator,
	progressor ioutil.Progressor,
	targetDir string,
) (Bundle, error)

DownloadBundle resolves both artifact locators through the same cache.

type CachingDownloader

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

func (*CachingDownloader) Download

func (d *CachingDownloader) Download(ctx context.Context, url string, progress ioutil.Progressor, targetDir string) (string, error)

type Downloader

type Downloader interface {
	Download(ctx context.Context, url string, progress ioutil.Progressor, targetDir string) (string, error)
}

type Extractor

type Extractor interface {
	Extract(src string, dest string) (string, error)
}

type HTTPDownloader

type HTTPDownloader struct{}

func (*HTTPDownloader) Download

func (d *HTTPDownloader) Download(ctx context.Context, url string, progress ioutil.Progressor, targetDir string) (string, error)

type Locator

type Locator struct {
	URL *url.URL
}

func MustNewFileLocator

func MustNewFileLocator(path string) *Locator

func MustNewLocatorFromURL

func MustNewLocatorFromURL(u string) *Locator

func NewFileLocator

func NewFileLocator(path string) (*Locator, error)

func NewLocatorFromURL

func NewLocatorFromURL(u string) (*Locator, error)

func (*Locator) Equal

func (a *Locator) Equal(b *Locator) bool

func (*Locator) IsEmbedded

func (a *Locator) IsEmbedded() bool

func (*Locator) MarshalTOML

func (a *Locator) MarshalTOML() ([]byte, error)

func (*Locator) MarshalText

func (a *Locator) MarshalText() ([]byte, error)

func (*Locator) UnmarshalTOML

func (a *Locator) UnmarshalTOML(i interface{}) error

func (*Locator) UnmarshalText

func (a *Locator) UnmarshalText(text []byte) error

type TarballExtractor

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

func (*TarballExtractor) Extract

func (e *TarballExtractor) Extract(src string, dest string) error

type TempDirTracker

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

func NewTempDirTracker

func NewTempDirTracker() *TempDirTracker

NewTempDirTracker creates a new tracker for temporary directories.

func (*TempDirTracker) Add

func (t *TempDirTracker) Add(dirPath string)

Add registers a temporary directory for cleanup.

func (*TempDirTracker) Cleanup

func (t *TempDirTracker) Cleanup() error

Cleanup removes all tracked temporary directories.

func (*TempDirTracker) GetTempDirs

func (t *TempDirTracker) GetTempDirs() []string

GetTempDirs returns a copy of the tracked directories (for testing/debugging).

Directories

Path Synopsis
cmd
mktar command

Jump to

Keyboard shortcuts

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