Documentation ¶
Index ¶
- func Base64DecodeSegment(seg string) ([]byte, error)
- func ByteCountIEC(b int64) string
- func CheckErr(e error, cmd *cobra.Command)
- func ChunkSliceOfInt(slice []int, chunkSize int) [][]int
- func ChunkString(s string, chunkSize int) []string
- func CreateDirectoryIfNotExists(directoryPath string)
- func CreateDirectoryIfNotExistsInHome(directoryPath string)
- func CreateFileIfNotExists(filePath string) error
- func CreateFileIfNotExistsInHome(filePath string) error
- func CreateRangeOfInt(min, max int) []int
- func DifferenceStrings(a, b []string) []string
- func DownloadFile(url, filename string) error
- func DuplicateStrings(arr []string) []string
- func Ellipsis(s string, max int) string
- func ExecuteCommandAndGetOutput(command string, flags ...string) (string, error)
- func ExtractTAR(src, dst string) error
- func ExtractZIP(src, dst string) error
- func FileExists(filePath string) bool
- func FileExistsInHome(filePath string) bool
- func FileHasTarExtension(filename string) bool
- func FileHasZIPExtension(filename string) bool
- func FormatCommas(num int) string
- func GetFromAPI(url string) ([]byte, error)
- func GetPermissions(filename string) (string, error)
- func GetRealSizeOf(v interface{}) (int, error)
- func IsOnPath(tool string) string
- func IsValidJSON(s string) bool
- func MakeFileExecutable(path string) error
- func MoveFile(file, target string) error
- func OpenURL(url string)
- func ParseInterfaceIntoJSON(yourThing interface{}) []byte
- func ParseJSON(bytes []byte) interface{}
- func ParseJSONIntoArray(bytes []byte) []interface{}
- func ParseJSONIntoMap(bytes []byte) map[string]interface{}
- func Percentage(partialValue, totalValue int) int
- func PrintAndReturnError(text string) error
- func PrintJSON(withColor bool, body []byte) error
- func PrintJSONString(withColor bool, body string) error
- func PrintYAML(s string) error
- func RemoveDirectory(path string) error
- func RemoveFile(path string) error
- func StringAfter(s, substring string) string
- func TarWithoutExtension(fileName string) string
- func Unique(strings []string) []string
- func ZIPWithoutExtension(fileName string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Base64DecodeSegment ¶
func ByteCountIEC ¶
func CheckErr ¶
CheckErr prints the msg with the prefix 'Error:' and exits with error code 1. If the msg is nil, it does nothing.
func ChunkSliceOfInt ¶
func ChunkString ¶
func CreateDirectoryIfNotExists ¶
func CreateDirectoryIfNotExists(directoryPath string)
func CreateDirectoryIfNotExistsInHome ¶
func CreateDirectoryIfNotExistsInHome(directoryPath string)
func CreateFileIfNotExists ¶
func CreateRangeOfInt ¶
func DifferenceStrings ¶
DifferenceStrings returns the elements that are in A, but not in B
func DownloadFile ¶
func DuplicateStrings ¶
func ExtractTAR ¶
ExtractTAR takes a destination path and a reader; a tar reader loops over the tarfile creating the file structure at 'dst' along the way, and writing any files
func ExtractZIP ¶
ExtractZIP takes a destination path and a reader; a tar reader loops over the zip file creating the file structure at 'dst' along the way, and writing any files
func FileExists ¶
func FileExistsInHome ¶
func FileHasTarExtension ¶
func FileHasZIPExtension ¶
func FormatCommas ¶
func GetFromAPI ¶
func GetPermissions ¶
func GetRealSizeOf ¶
func IsValidJSON ¶
func MakeFileExecutable ¶
func ParseInterfaceIntoJSON ¶
func ParseInterfaceIntoJSON(yourThing interface{}) []byte
func ParseJSONIntoArray ¶
func ParseJSONIntoArray(bytes []byte) []interface{}
func ParseJSONIntoMap ¶
func Percentage ¶
func PrintAndReturnError ¶
func PrintJSONString ¶
func RemoveDirectory ¶
func RemoveFile ¶
func StringAfter ¶
func TarWithoutExtension ¶
func ZIPWithoutExtension ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.