utils

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2022 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DownloadFile

func DownloadFile(uri, filepath string) error

DownloadFile download a file from the internet and save it to disk

func ExecCMD

func ExecCMD(dir, cmd string, env []string) (string, error)

ExecCMD run the command in /bin/sh

func ExtractTar

func ExtractTar(filename, path string) error

ExtractTar ...

func FindInFile

func FindInFile(filepath, v string) bool

FindInFile find text in file

func HTTPGet

func HTTPGet(uri string) ([]byte, error)

HTTPGet make http get request

func HTTPJson

func HTTPJson(uri string, v interface{}) error

HTTPJson ...

func MakeDir

func MakeDir(path string) error

MakeDir check dir and create if not exist

func ValidateHash

func ValidateHash(filename, hash string) error

ValidateHash check hash

func WriteFile

func WriteFile(filepath string, v ...string) error

WriteFile write strings to file

Types

This section is empty.

Jump to

Keyboard shortcuts

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