Documentation
¶
Overview ¶
Package fetch downloads the tools and releases the modlock command needs into the user cache.
Index ¶
- Constants
- Variables
- func Cache(name ...string) (string, error)
- func File(ctx context.Context, url, path string) error
- func Install(dir string, fill func(staging string) error) error
- func LatestMaster(ctx context.Context) (string, error)
- func Master(version string) bool
- func MasterVersion(commit string) string
- func Published(version string) bool
- func Release(version, asset string) string
- func ReleaseFile(ctx context.Context, version, asset, path string) error
- func Untar(archive, name, target string) error
- func UntarTree(archive, prefix, dir string) error
- func Unzip(archive, name, target string) error
- func Verify(path, sum string) error
- func WalkTar(archive string, ...) error
Constants ¶
const MasterTag = "master-build"
MasterTag is the prerelease that holds the newest build of the master branch. Each push to master replaces its files.
Variables ¶
var ErrSuperseded = errors.New("master has moved on from this build; run modlock update")
ErrSuperseded reports that the master prerelease no longer holds the build asked for, because a later push replaced it.
Functions ¶
func Install ¶
Install fills dir once: it runs fill on a staging path beside dir and moves the result into place whole, so an interrupted install never looks complete. It does nothing when dir exists. Each install stages in a directory of its own, so installs of one dir may run at once, in one process or several; the first to finish installs, and the rest find dir in place. fill may keep scratch files, such as a downloaded archive, at staging plus a suffix: they share the private directory, which Install removes.
func LatestMaster ¶ added in v0.1.81
LatestMaster returns the version of the build the master prerelease holds.
func Master ¶ added in v0.1.81
Master reports whether version names a build of the master branch, such as master-0123456789ab.
func MasterVersion ¶ added in v0.1.81
MasterVersion returns the version of the build of master at commit.
func Published ¶ added in v0.1.81
Published reports whether version has files to download: a release, such as v0.1.9, or a build of master, but not a development build.
func Release ¶
Release returns the address of asset among the files of version: its own release, or the master prerelease for a build of master.
func ReleaseFile ¶ added in v0.1.81
ReleaseFile writes asset from the files of version to path. A build of master shares one prerelease with every later build, so ReleaseFile checks after the download that the prerelease still holds version, and returns ErrSuperseded when it does not: the file may belong to a later build.
func UntarTree ¶ added in v0.1.4
UntarTree writes the regular files under the directory prefix in the gzipped tar archive into dir, keeping their paths below prefix and their modes. An empty prefix writes every file.
Types ¶
This section is empty.