askalono

package
v0.0.17 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AskalonoVersion is the version string used in the git tag. These can
	// be seen here: https://github.com/jpeddicord/askalono/releases/
	AskalonoVersion = "0.4.6"
)

Variables

View Source
var Askalono046Linux []byte
View Source
var Askalono046Windows []byte
View Source
var Askalono046macOS []byte
View Source
var AskalonoHashes = map[string]map[string]string{
	"0.4.6": {
		"linux":   "a089146694cf433a4580c3da414cf43c70722ba6398d214fe41ca27b53deb476",
		"darwin":  "1e006e6c61ec4abd714ae930a94b2f447c57392d621a6e8367c7aaa4cb4f427c",
		"windows": "89f477e6e70e9bb58caf3b1f6a22fc6566e182ff81c3a920d49b6e6947ee97a1",
	},
}

AskalonoHashes maps version number, os, and then sha256sum. These are the hashes of the actual binaries, not the .zip files they are in. We ultimately care just about the integrity of the binary, so that's all we need to check. We don't also need to check the hash of the zip files, since we aren't worried about opening a zip file being dangerous. FIXME: We don't support different architectures for now. (eg: runtime.GOARCH)

Functions

func GetExpectedHash

func GetExpectedHash() (string, error)

GetExpectedHash returns the expected hash of the binary for this version and OS.

func GetExpectedName

func GetExpectedName() (safepath.RelFile, error)

GetExpectedName returns the expected name of the binary for a given platform. This happens to also be the path it is expected to be found in the zip file because the packages contain that single file in the root. If this ever changes, then we need to add an additional GetExpectedPath method and change the logic.

func GetZip added in v0.0.10

func GetZip() ([]byte, error)

GetZip returns the correct zipped package for this OS and ARCH. If it doesn't have one available, then it errors.

func InstallBinary

func InstallBinary(absDir safepath.AbsDir) (int64, safepath.AbsFile, error)

InstallBinary installs an askalono binary into this dir if it's not there already or if it has the wrong hash. It then returns its extracted size, and its complete path.

Types

This section is empty.

Jump to

Keyboard shortcuts

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