artifacts

package
v1.18.1 Latest Latest
Warning

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

Go to latest
Published: May 14, 2026 License: MIT Imports: 21 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 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 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