utils

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2024 License: MIT Imports: 17 Imported by: 14

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 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 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)

Jump to

Keyboard shortcuts

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