helper

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2022 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ByteCountSI

func ByteCountSI(b int64) string

ByteCountSI converts bytes to a human-readable format

func Check

func Check(e error)

Check panics if error is not nil

func CreateDir

func CreateDir(name string)

CreateDir creates the data folder if it does not exist

func FileExists

func FileExists(filename string) bool

FileExists returns true if a file exists

func FolderExists

func FolderExists(folder string) bool

FolderExists returns true if a folder exists

func GenerateRandomString

func GenerateRandomString(length int) string

GenerateRandomString returns a URL-safe, base64 encoded securely generated random string.

func GetFileSize

func GetFileSize(file *os.File) (int64, error)

GetFileSize returns the file size in bytes

func IsInArray

func IsInArray(haystack []string, needle string) bool

IsInArray returns true if value is in array

func ReadLine

func ReadLine() string

ReadLine reads a line from the terminal and returns it as a string

func ReadPassword

func ReadPassword() string

ReadPassword reads a line without displaying input from the terminal and returns it as a string

Types

This section is empty.

Jump to

Keyboard shortcuts

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