util

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2020 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SHASumSuffix = "SHA256SUMS"
)
View Source
const UserAgent = "HashiCorp hashi-bin CLI utility"

Variables

This section is empty.

Functions

func BinDir

func BinDir(product string) (string, error)

func CheckBytes

func CheckBytes(fileName string, b []byte) error

func CheckFile

func CheckFile(fpath string) error

func CurrentActive

func CurrentActive(product string) (version string, link string, target string)

func ExtractZip

func ExtractZip(product, parentDir string, bts []byte) (string, error)

func GetSHASums

func GetSHASums(product, version string) (map[string][]byte, error)

func HTTPGet

func HTTPGet(url string) (*http.Response, error)

func HTTPGetBody

func HTTPGetBody(url string) ([]byte, error)

func InArray

func InArray(arr []string, str string) bool

func LinkPath

func LinkPath(product string) string

func ListInstalled

func ListInstalled(product string) ([]string, error)

func ProductVersionFromName

func ProductVersionFromName(fileName string) (string, string)
func RemoveLink(product string) error
func SHASumLink(product, version string) string

Types

type ExtraOptions

type ExtraOptions struct {
	All  bool
	Beta bool
	Ent  bool
}

func GetOptions

func GetOptions() ExtraOptions

Jump to

Keyboard shortcuts

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