utils

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompL

func CompL[T any, V any](objs []T, lambda func(x T) V) []V

func Contains

func Contains(s []string, str string) bool

func FileExists

func FileExists(filename utils_types.FilePath) bool

func FixtureDevEnv

func FixtureDevEnv() bool

func GetCurrentFile

func GetCurrentFile() utils_types.FilePath

func GetCurrentFolder

func GetCurrentFolder() utils_types.FilePath

func GetCurrrentChildFolder

func GetCurrrentChildFolder(folder_name string) utils_types.FilePath

func GetCurrrentTempFolder

func GetCurrrentTempFolder() utils_types.FilePath

func GetCurrrentTestFolder

func GetCurrrentTestFolder() utils_types.FilePath

func GetProjectDir

func GetProjectDir() utils_types.FilePath

func InitRegexExpression

func InitRegexExpression(regex **regexp.Regexp, expression utils_types.RegExp)

func Keys

func Keys[M ~map[K]V, K comparable, V any](m M) []K

Keys returns the keys of the map m. The keys will be an indeterminate order.

func NewReadFile

func NewReadFile(filepath utils_types.FilePath, callback func(*FileRead))

func NewWriteFile

func NewWriteFile(filepath utils_types.FilePath, callback func(*FileWrite))

func Ptr

func Ptr[T any](v T) *T

func RegenerativeTest

func RegenerativeTest(callback func() error) error

func ReverseSlice

func ReverseSlice(s interface{})

func ShellRunArgs

func ShellRunArgs(program string, args ...string)

func SleepAwaitCtrlC

func SleepAwaitCtrlC()

func SleepForever

func SleepForever()

func StringWithCharset

func StringWithCharset(length int, charset string) string

func TmpRender

func TmpRender(templateRef *template.Template, data interface{}) string

func TokenHex

func TokenHex(length int) string

Types

type ErrorNotFound

type ErrorNotFound struct {
}

func (ErrorNotFound) Error

func (err ErrorNotFound) Error() string

type FileRead

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

func (*FileRead) ReadLines

func (f *FileRead) ReadLines() []string

type FileWrite

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

func (*FileWrite) WritelnF

func (f *FileWrite) WritelnF(msg string)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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