downloader

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2026 License: MIT Imports: 14 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package downloader provides platform-independent binary download from GitHub Releases. It detects the current platform, downloads the correct archive, verifies SHA-256 checksums, and installs the binary atomically.

Index

Constants

This section is empty.

Variables

View Source
var ErrUnsupportedPlatform = errors.New("unsupported platform")

ErrUnsupportedPlatform is returned when the current platform is not supported.

Functions

func DefaultDestSubdir

func DefaultDestSubdir() string

DefaultDestSubdir returns the default subdirectory under home for the binary.

func IsVersionNotFoundErr

func IsVersionNotFoundErr(err error) bool

IsVersionNotFoundErr checks if an error indicates the release version was not found (404).

func SupportedPlatforms

func SupportedPlatforms() []string

SupportedPlatforms returns a list of supported platform strings for error messages.

Types

type DownloadResult

type DownloadResult struct {
	Success bool
	Path    string
	Version string
}

DownloadResult holds the outcome of a binary download operation.

func DownloadBinary

func DownloadBinary(version, destDir string) (*DownloadResult, error)

DownloadBinary downloads and installs the aether binary for the current platform.

Parameters:

  • version: semver string (e.g. "1.0.0"), without "v" prefix
  • destDir: directory to install the binary into (e.g. "~/.aether/bin")

Returns a DownloadResult with success status and installed path.

type HashResult

type HashResult struct {
	Hash    string
	TmpPath string
}

HashResult holds the computed SHA-256 hash and path of a downloaded file.

type Platform

type Platform struct {
	OS   string
	Arch string
}

Platform holds detected OS and architecture in goreleaser naming convention.

Jump to

Keyboard shortcuts

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