support

package
v1.9.1 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2023 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains[T comparable](list []T, val T) bool

func ContainsSome

func ContainsSome[v comparable](list []v, vals []v) bool

func DirMustExist

func DirMustExist(dirPath string) error

func FindIndex

func FindIndex[T any](list []T, test func(T) bool) (int, bool)

func GetBinDirPath

func GetBinDirPath() string

func GetEnvDur

func GetEnvDur(key string, def time.Duration) (time.Duration, error)

GetEnvDur from OS.

func GetEnvInt

func GetEnvInt(key string, def int) (int, error)

GetEnvInt from OS.

func GetEnvString

func GetEnvString(key, def string) string

GetEnvString from OS.

func HashSHA256

func HashSHA256(s string) (string, error)

func Logger

func Logger(process string, tags map[string]interface{}) zerolog.Logger

func LoggerToFile

func LoggerToFile(filename string) (*os.File, error)

func MergeChanners

func MergeChanners[T any](list ...<-chan T) <-chan T

func RandInt

func RandInt(min, max int32) (int32, error)

func Random

func Random[T any](list []T) T

func SetupLogger

func SetupLogger(level, format string, tags map[string]interface{})

func Shuffle

func Shuffle[T any](list []T) []T

func ToLower

func ToLower(list []string) []string

func WithKillSignal

func WithKillSignal(ctx context.Context) (context.Context, context.CancelFunc)

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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