utils

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ColorRed    = "\033[1;31m"
	ColorGreen  = "\033[1;32m"
	ColorYellow = "\033[1;33m"
	ColorPurple = "\033[1;35m"
	ColorWhite  = "\033[1;37m"
	ColorReset  = "\033[m"
)

Variables

View Source
var (
	LowerCaseLettersCharset = []rune("abcdefghijklmnopqrstuvwxyz")
	UpperCaseLettersCharset = []rune("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
	LettersCharset          = append(LowerCaseLettersCharset, UpperCaseLettersCharset...)
	NumbersCharset          = []rune("0123456789")
	AlphanumericCharset     = append(LettersCharset, NumbersCharset...)
	SpecialCharset          = []rune("!@#$%^&*()_+-=[]{}|;':\",./<>?")
	AllCharset              = append(AlphanumericCharset, SpecialCharset...)
)

Functions

func AnyToString added in v0.6.1

func AnyToString(value any) string

func BytesToString added in v0.6.1

func BytesToString(b []byte) string

https://github.com/golang/go/issues/53003

func Bytesify added in v0.7.25

func Bytesify(value any) []byte

func Debug added in v0.9.0

func Debug(args ...any)

func Debugf added in v0.9.0

func Debugf(formatter string, args ...any)

func DeduplicateSlice added in v0.8.4

func DeduplicateSlice[T comparable, Slice ~[]T](collection Slice) Slice

func Error added in v0.9.0

func Error(args ...any)

func Errorf added in v0.9.0

func Errorf(formatter string, args ...any)

func Fatal added in v0.9.0

func Fatal(args ...any)

func Fatalf added in v0.9.0

func Fatalf(formatter string, args ...any)

func Info added in v0.9.0

func Info(args ...any)

func Infof added in v0.9.0

func Infof(formatter string, args ...any)

func MapToString added in v0.6.1

func MapToString(record map[string]string, sorted bool) string

func RandomString added in v0.7.25

func RandomString(size int, charset []rune) string

RandomString return a random string. Play: https://go.dev/play/p/rRseOQVVum4

func StringToBytes added in v0.6.1

func StringToBytes(s string) []byte

func StringToMap added in v0.6.1

func StringToMap(data string, fieldSep string, valueSep string) map[string]string

func Stringify added in v0.7.13

func Stringify(value any) string

func UpdateGOMAXPROCS added in v0.6.1

func UpdateGOMAXPROCS(printf func(formatter string, args ...any), interval time.Duration) func()

func Wait added in v0.10.0

func Wait(ctx context.Context, timeout time.Duration, interval time.Duration, fn func() bool)

func Warn added in v0.9.0

func Warn(args ...any)

func Warnf added in v0.9.0

func Warnf(formatter string, args ...any)

func Words added in v0.7.25

func Words(str string) []string

Words splits string into an array of its words.

Types

This section is empty.

Jump to

Keyboard shortcuts

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