utils

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateRandomText

func GenerateRandomText(length int) string

func GenerateUniqueNumber

func GenerateUniqueNumber(length int) string

func InList

func InList[T string | int64](lst []T, element T) bool

func IsJsonString

func IsJsonString(data string) bool

func JoinIntToString

func JoinIntToString(lst []int64, seq string, removeDuplicates bool) string

func JoinStringToString

func JoinStringToString(lst []string, seq string, removeDuplicates bool) string

func JsonMarshal

func JsonMarshal(v interface{}) ([]byte, errors.WTError)

func JsonUnmarshal

func JsonUnmarshal(data []byte, v interface{}) errors.WTError

func ListConvert

func ListConvert[T1, T2 string | int64](lst []T1, m map[T1]T2) []T2

func ListConvertMust

func ListConvertMust[T1, T2 string | int64](lst []T1, m map[T1]T2) ([]T2, errors.WTError)

func RemoveDuplicates

func RemoveDuplicates[T string | int64](lst []T) []T

func RemoveTrailingNil

func RemoveTrailingNil[T any](lst []T, isZero func(T) bool) []T

func SplitStringToInt

func SplitStringToInt(lst string, seq string) []int64

func StringCalculateHMAC

func StringCalculateHMAC(key, data string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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