utils

package
v0.0.0-...-4957f45 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2022 License: MIT Imports: 20 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 BannerF

func BannerF(format string, data string)

BannerF print info message

func BlockF

func BlockF(name string, data string)

BlockF print info message

func ChunkFileByPart

func ChunkFileByPart(source string, chunk int) [][]string

ChunkFileByPart chunk file to multiple part

func ChunkFileBySize

func ChunkFileBySize(source string, chunk int) [][]string

ChunkFileBySize chunk file to multiple part

func CopyDir

func CopyDir(src string, dst string) error

CopyDir copy directory to dest

func CopyFile

func CopyFile(src, dst string) error

CopyFile copies a single file from src to dst

func DebugF

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

DebugF print debug message

func DirLength

func DirLength(dir string) int

DirLength count len of file

func ErrorF

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

ErrorF print good message

func ExpandLength

func ExpandLength(list []string, length int) []string

ExpandLength make slice to length

func FileExists

func FileExists(filename string) bool

FileExists check if file is exist or not

func FileLength

func FileLength(filename string) int

FileLength count len of file

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 GetFileContent

func GetFileContent(filename string) string

GetFileContent Reading file and return content of it

func GetFileNames

func GetFileNames(dir string, ext string) []string

GetFileNames get all file name with extension

func GetFileSize

func GetFileSize(src string) float64

GetFileSize get file size of a file in GB

func GetOSEnv

func GetOSEnv(name string) string

GetOSEnv get enviroment 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 IsJSON

func IsJSON(str string) bool

IsJSON check if string is JSON or not

func JoinURL

func JoinURL(raw string, suffix string) string

func MakeDir

func MakeDir(folder string)

MakeDir just make a folder

func MoveFolder

func MoveFolder(src string, dest string)

MoveFolder move folder

func NormalizePath

func NormalizePath(path string) string

NormalizePath the path

func PrintLine

func PrintLine()

PrintLine print seperate line

func PromptConfirm

func PromptConfirm(s string) bool

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 StartWithNum

func StartWithNum(raw string) bool

StartWithNum check if string start with number

func StrToInt

func StrToInt(data string) int

StrToInt string to int

func StripName

func StripName(raw string) string

StripName strip a file name

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