artifacts

package
v1.16.13 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2026 License: MIT Imports: 21 Imported by: 3 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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