Documentation
¶
Index ¶
- Constants
- Variables
- func CleanupAll() error
- func ContentDigest(bundle fs.FS) (common.Hash, error)
- func CreateHttpLocator(contentHash string) string
- func Download(ctx context.Context, loc *Locator, progressor ioutil.Progressor, ...) (foundry.StatDirFs, error)
- func ExtractEmbedded(destDir string) (foundry.StatDirFs, error)
- func ExtractFromFile(destDir string, tarFilePath string) (foundry.StatDirFs, error)
- func GetCleanupDirs() []string
- func RegisterForCleanup(dirPath string)
- type Bundle
- type CachingDownloader
- type Downloader
- type Extractor
- type HTTPDownloader
- type Locator
- type TarballExtractor
- type TempDirTracker
Constants ¶
const EmbeddedLocatorString = "embedded"
Variables ¶
var DefaultL1ContractsLocator = EmbeddedLocator
var DefaultL2ContractsLocator = EmbeddedLocator
var EmbeddedLocator = &Locator{
URL: embeddedURL,
}
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
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 ExtractFromFile ¶
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
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
}
type Downloader ¶
type HTTPDownloader ¶
type HTTPDownloader struct{}
type Locator ¶
func MustNewFileLocator ¶
func MustNewLocatorFromURL ¶
func NewFileLocator ¶
func NewLocatorFromURL ¶
func (*Locator) IsEmbedded ¶
func (*Locator) MarshalTOML ¶
func (*Locator) MarshalText ¶
func (*Locator) UnmarshalTOML ¶
func (*Locator) UnmarshalText ¶
type TarballExtractor ¶
type TarballExtractor struct {
// contains filtered or unexported fields
}
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).