utils

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2021 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendToContent

func AppendToContent(filename string, data string) (string, error)

AppendToContent append string to a file

func BadBlockF

func BadBlockF(name string, data string)

BadBlockF print info message

func BannerF

func BannerF(format string, data string)

BannerF print info message

func BlockF

func BlockF(name string, data string)

BlockF print info message

func CalcTimeout

func CalcTimeout(raw string) int

CalcTimeout calculate timeout

func DebugF

func DebugF(format string, args ...interface{})

DebugF print debug message

func EmptyDir

func EmptyDir(dir string) bool

EmptyDir check if directory is empty or not

func EmptyFile

func EmptyFile(filename string, num int) bool

EmptyFile check if file is empty or not

func ErrorF

func ErrorF(format string, args ...interface{})

ErrorF print good message

func FileExists

func FileExists(filename string) bool

FileExists check if file is exist or not

func FolderExists

func FolderExists(foldername string) bool

FolderExists check if file is exist or not

func GenHash

func GenHash(text string) string

GenHash gen SHA1 hash from string

func GetCurrentDay

func GetCurrentDay() string

GetCurrentDay get current day

func GetDomain

func GetDomain(raw string) (string, error)

GetDomain get domain from the URL

func GetFileContent

func GetFileContent(filename string) string

GetFileContent Reading file and return content of it

func GetFileSize

func GetFileSize(src string) float64

GetFileSize get file size of a file in GB

func GetOSEnv

func GetOSEnv(name string, alt string) string

GetOSEnv get environment variable

func GetTS

func GetTS() string

GetTS get current timestamp and return a string

func GoodF

func GoodF(format string, args ...interface{})

GoodF print good message

func InforF

func InforF(format string, args ...interface{})

InforF print info message

func InitLog

func InitLog(options *libs.Options)

InitLog init log

func MakeDir

func MakeDir(folder string)

MakeDir just make a folder

func NormalizePath

func NormalizePath(path string) string

NormalizePath the path

func PrintLine

func PrintLine()

PrintLine print seperate line

func RandomString

func RandomString(n int) string

RandomString return a random string with length

func ReadingFileUnique

func ReadingFileUnique(filename string) []string

ReadingFileUnique Reading file and return content as []string

func ReadingLines

func ReadingLines(filename string) []string

ReadingLines Reading file and return content as []string

func RunCmdWithOutput

func RunCmdWithOutput(cmd string) string

RunCmdWithOutput just run os command

func RunOSCommand

func RunOSCommand(cmd string)

RunOSCommand just run os command

func StrToInt

func StrToInt(data string) int

StrToInt string to int

func WarningF

func WarningF(format string, args ...interface{})

WarningF print good message

func WriteToFile

func WriteToFile(filename string, data string) (string, error)

WriteToFile write string to a file

Types

This section is empty.

Jump to

Keyboard shortcuts

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