package download
import "github.com/purpleidea/mgmt/lang/download"
Package download is used for downloading language modules from git.
Index ¶
Types ¶
type Downloader ¶
type Downloader struct { // Depth is the max recursion depth that we should descent to. A // negative value means infinite. This is usually the default. Depth int // Retry is the max number of retries we should run if we encounter a // network error. A negative value means infinite. The default is // usually zero. Retry int // contains filtered or unexported fields }
Downloader implements the Downloader interface. It provides a mechanism to pull down new code from the internet. This is usually done with git.
func (*Downloader) Get ¶
func (obj *Downloader) Get(info *interfaces.ImportData, modulesPath string) error
Get runs a single download of an import and stores it on disk. XXX: this should only touch the filesystem via obj.info.Fs, but that is not implemented at the moment, so we cheat and use the local fs directly. This is not disastrous, since we only run Get on a local fs, since we don't download to etcdfs directly with the downloader during a deploy. This is because we'd need to implement the afero.Fs -> billy.Filesystem mapping layer.
func (*Downloader) Init ¶
func (obj *Downloader) Init(info *interfaces.DownloadInfo) error
Init initializes the downloader with some core structures we'll need.
Source Files ¶
- Version
- v0.0.0-20250322185616-c50a578426f1 (latest)
- Published
- Mar 22, 2025
- Platform
- linux/amd64
- Imports
- 8 packages
- Last checked
- 5 days ago –
Tools for package owners.