Documentation
¶
Index ¶
- Constants
- Variables
- func CleanupAll() 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 CachingDownloader
- type Downloader
- type Extractor
- type HTTPDownloader
- type Locator
- type TarballExtractor
- type TempDirTracker
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 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 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).
Source Files
¶
Click to show internal directories.
Click to hide internal directories.