fetch

package
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 14, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package fetch downloads the tools and releases the modlock command needs into the user cache.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cache

func Cache(name ...string) (string, error)

Cache returns the directory under the user cache that holds name.

func File

func File(ctx context.Context, url, path string) error

File writes the body at url to path, creating its directory.

func Install

func Install(dir string, fill func(staging string) error) error

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.

func Release

func Release(version, asset string) string

Release returns the address of asset in the Modlock release tagged version.

func Untar

func Untar(archive, name, target string) error

Untar writes the gzipped tar archive's file name to target as an executable.

func Unzip

func Unzip(archive, name, target string) error

Unzip writes the zip archive's file name to target as an executable.

func Verify

func Verify(path, sum string) error

Verify checks that the file at path has the SHA-256 sum.

func WalkTar

func WalkTar(archive string, visit func(name string, mode fs.FileMode, body io.Reader) error) error

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.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL