utils

package
v0.0.0-...-4e6b2c2 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyFile

func CopyFile(src, dst string) error

func CreateDirectory

func CreateDirectory(dirName string) bool

CreateDirectory creates a directory tree. Returns true if could create it and false in any other case

func FileExists

func FileExists(fileName string) bool

FileExists check if the file with name as argument exists

func PrepareString

func PrepareString(value string) string

PrepareString removes special chars, words between brackets, alternative text and covert the string to lower case

func RemoveBracketsContent

func RemoveBracketsContent(value string) string

RemoveBracketsContent returns the string without brackets and without the content inside of them

func RemoveDirectory

func RemoveDirectory(dirName string) bool

RemoveDirectory removes a directory tree. Returns true if could remove it and false if any errors were found

func RemoveFile

func RemoveFile(fileName string) bool

RemoveFile removes a file. Returns true if coult remove it and false if any errors were found

func SetupLogs

func SetupLogs(logsLevel string, timestampFormat string, fullTimestamp bool)

SetupLogs set the format for Logrus logs

func SetupViper

func SetupViper(path string)

SetupViper initialize viper with the config file in the path passed as parameter

func ToSnakeCase

func ToSnakeCase(value string) string

ToSnakeCase returns the string in snake case format

func TrimAllSpaces

func TrimAllSpaces(value string) string

TrimAllSpaces returns the string passed as argument without spaces and in lower key

func UintInSlice

func UintInSlice(elem uint, list []uint) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

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