Discover Packages
github.com/paralin/modlock
internal
fetch
package
Version:
v0.1.3
Opens a new window with list of versions in this module.
Published: Oct 14, 2026
License: MIT
Opens a new window with license information.
Imports: 13
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Jump to ...
Documentation
Overview
Index
Constants
Variables
Functions
Cache(name)
File(ctx, url, path)
Install(dir, fill)
Release(version, asset)
Untar(archive, name, target)
Unzip(archive, name, target)
Verify(path, sum)
WalkTar(archive, visit)
Types
Source Files
Documentation
Documentation
¶
Package fetch downloads the tools and releases the modlock command needs
into the user cache.
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 Release(version, asset string) string
func Untar(archive, name, target string) error
func Unzip(archive, name, target string) error
func Verify(path, sum string) error
func WalkTar(archive string, ...) error
Cache returns the directory under the user cache that holds name.
File writes the body at url to path, creating its directory.
Install fills dir once: it runs fill on a staging directory beside dir and
moves the result into place whole, so an interrupted install never looks
complete. It does nothing when dir exists.
Release returns the address of asset in the Modlock release tagged version.
Untar writes the gzipped tar archive's file name to target as an
executable.
Unzip writes the zip archive's file name to target as an executable.
Verify checks that the file at path has the SHA-256 sum.
WalkTar calls visit with the cleaned slash-separated name, permission bits
and contents of each regular file in the gzipped tar archive at archive, in
archive order. It stops at the first error visit returns; fs.SkipAll stops
the walk and returns nil.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.