utils

package
v0.0.0-...-1f41fd7 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArrayToMap

func ArrayToMap[K Hashable, V any](arr []K, defVal V) map[K]V

func ArrayToMapUniversal

func ArrayToMapUniversal[K, R any, V Hashable](arr []K, val func(K) R, key func(K) V) map[V]R

func DecodeBase64

func DecodeBase64(data string) (string, error)

func EncodeBase64

func EncodeBase64(data string) string

func ReadConfig

func ReadConfig(parseTo interface{}, names ...string) error

func SHA256

func SHA256(data string) string

func Sleep

func Sleep(d time.Duration) bool

func SleepHours

func SleepHours(hours int) bool

func SleepMinutes

func SleepMinutes(min int) bool

func SleepSeconds

func SleepSeconds(sec int) bool

func Ternary

func Ternary[K any](condition bool, v1, v2 K) K

func UnpackDefault

func UnpackDefault[K any](arr []K, defVal K) K

func ValidateEmail

func ValidateEmail(email string) bool

Types

type Hashable

type Hashable interface {
	int | string
}

Jump to

Keyboard shortcuts

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