util

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPermissionsToDir

func CheckPermissionsToDir(dirpath string) bool

CheckPermissionsToDir checks if instl can write to a directory

func Contains added in v1.11.0

func Contains[T comparable](slice []T, element T) bool

Contains checks if a slice contains an element

func DownloadFile

func DownloadFile(output, url string) error

DownloadFile downloads a file to tmp and displays a progressbar. The file will be moved to output directory when downloading is finished.

func FileExists

func FileExists(path string) bool

FileExists checks if a file exists.

func FindBinary

func FindBinary(path string) (binaryPath, binaryName string, err error)

FindBinary tries to find a binary in the release asset.

func GitHubStringToRepo

func GitHubStringToRepo(repoString string) (owner, repo, version string, err error)

Types

type WriteCounter

type WriteCounter struct {
	Total uint64
	// contains filtered or unexported fields
}

WriteCounter counts the number of bytes written to it.

func (*WriteCounter) Write

func (wc *WriteCounter) Write(p []byte) (int, error)

Jump to

Keyboard shortcuts

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