artifacts

package
v1.13.2 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2025 License: MIT Imports: 21 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultL1ContractsLocator = &Locator{
	Tag: standard.DefaultL1ContractsTag,
}
View Source
var DefaultL2ContractsLocator = &Locator{
	Tag: standard.DefaultL2ContractsTag,
}
View Source
var ErrUnsupportedArtifactsScheme = errors.New("unsupported artifacts URL scheme")

Functions

func Download

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

Types

type CachingDownloader

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

func (*CachingDownloader) Download

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

type DownloadProgressor added in v1.9.5

type DownloadProgressor func(current, total int64)

func BarProgressor added in v1.11.0

func BarProgressor() DownloadProgressor

func LogProgressor added in v1.9.5

func LogProgressor(lgr log.Logger) DownloadProgressor

func NoopProgressor added in v1.11.0

func NoopProgressor() DownloadProgressor

type Downloader

type Downloader interface {
	Download(ctx context.Context, url string, progress DownloadProgressor, 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 DownloadProgressor, targetDir string) (string, error)

type Locator

type Locator struct {
	URL *url.URL
	Tag string
}

func MustNewFileLocator

func MustNewFileLocator(path string) *Locator

func MustNewLocatorFromTag added in v1.10.0

func MustNewLocatorFromTag(tag string) *Locator

func MustNewLocatorFromURL

func MustNewLocatorFromURL(u string) *Locator

func NewFileLocator

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

func NewLocatorFromTag added in v1.10.0

func NewLocatorFromTag(tag string) (*Locator, error)

func NewLocatorFromURL

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

func (*Locator) Equal

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

func (*Locator) IsTag added in v1.9.5

func (a *Locator) IsTag() bool

func (*Locator) MarshalText

func (a *Locator) MarshalText() ([]byte, 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

Jump to

Keyboard shortcuts

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