utils

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2023 License: Unlicense Imports: 14 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 DirExists

func DirExists(name string) bool

DirExists reports whether the dir exists as a boolean, taken from https://stackoverflow.com/a/49697453 / https://stackoverflow.com/a/51870143/3337885

func FileExists

func FileExists(name string) bool

func GetRandomInt

func GetRandomInt(min, max int) int

func GetRandomString

func GetRandomString(chars string, length int) string

func GetRandomStringFromList

func GetRandomStringFromList(strings ...string) string

func IntFromString

func IntFromString(str string, def int) int

func ListFiles

func ListFiles(directory string) []string

func ReadFile

func ReadFile(filename string) ([]byte, error)

func RemoveNonPrintable

func RemoveNonPrintable(str string) string

Types

type FilesCache

type FilesCache struct {
	// contains filtered or unexported fields
}

func NewFilesCache

func NewFilesCache(path string, errorHandler func(err error)) *FilesCache

func (*FilesCache) GetRandomLineFromFile

func (fc *FilesCache) GetRandomLineFromFile(file string) string

Jump to

Keyboard shortcuts

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