Versions in this module Expand all Collapse all v1 v1.0.1 Apr 11, 2024 Changes in this version + const CNGMT + const MaxSnowflakeNodeIndex + const TimeDay + const TimeLayout + var CNTimeLocation *time.Location + func AnyArrayToFloat64Array(arrInterface []interface{}) []float64 + func AnyArrayToInt64Array(arrInterface []interface{}) []int64 + func AnyArrayToStringArray(arrInterface []interface{}) []string + func AnyToBool(v interface{}) bool + func AnyToBoolArray(any interface{}) []bool + func AnyToFloat64(value interface{}) float64 + func AnyToFloat64Array(any interface{}) []float64 + func AnyToInt64(value interface{}) int64 + func AnyToInt64Array(any interface{}) []int64 + func AnyToMapStringAny(content any) map[string]any + func AnyToString(value interface{}) string + func AnyToStringArray(any interface{}) []string + func BytesToString(b []byte) string + func CNFormatToTime(timeString string) time.Time + func CanConvertToFloat32Loselessly(v float64) bool + func CanConvertToInt32Loselessly(v float64) bool + func CanConvertToInt64Loselessly(v float64) bool + func CheckEmail(str string) bool + func DayDiff(date1, date2 time.Time, loc *time.Location) int + func EnvironmentVariables() map[string]string + func FilterSlice[Element any](slice []Element, fn func(e Element) bool) (ret []Element) + func FindFirstInSliceWhere[Element any](slice []Element, fn func(e Element) bool) int + func FindFirstRefInSliceWhere[Element any](slice []Element, fn func(e Element) bool) *Element + func FindInAnyMap(m AnyMap, keys ...interface{}) interface + func FindInAnyMapWithKeys(m AnyMap, keys []interface{}) interface + func FindInFloat64Array(slice []float64, item float64) int + func FindInInt64Array(slice []int64, item int64) int + func FindInSlice[Element comparable](slice []Element, item Element) int + func FindInStrMap(m StrMap, keys ...interface{}) interface + func FindInStrMapWithKeys(m StrMap, keys []interface{}) interface + func FindInStrings(slice []string, item string) int + func FindInSyncMap(m *sync.Map, keys ...interface{}) interface + func FindInSyncMapWithKeys(m *sync.Map, keys []interface{}) interface + func GenID(prefix string) string + func GenPassword() string + func GenUUID() string + func GenerateFixedLengthRandomString(length uint8) string + func GenerateFixedLengthUUID(length uint8) string + func GenerateSnowflakeID() snowflake.ID + func GetCNCurrentTime() time.Time + func GetCNFormatCurrentTime() string + func Hash(bs []byte) uint32 + func InitSnowflakeNode(index int64) + func IsAlnumString(s string) bool + func IsAlphaString(s string) bool + func IsDateEqual(date1, date2 time.Time, loc *time.Location) bool + func IsNumString(s string) bool + func IsNumeric(value interface{}) bool + func IsSliceEqual[Element comparable](slice1, slice2 []Element) bool + func MapSlice[Element any, Return any](slice []Element, fn func(Element) Return) []Return + func MaxInt64(a, b int64) int64 + func Max[Value Number](l, r Value) Value + func MillisecondOfTime(t time.Time) int64 + func MinInt64(a, b int64) int64 + func Min[Value Number](l, r Value) Value + func PanicIfNotNil(err error) + func RemovePrefixKeys(data map[string]any, prefix string) + func ReversedSlice[Element any](slice []Element) []Element + func StringPToBytes(s *string) []byte + func StringToBytes(s string) []byte + func StringToChunks(s string, chunkSize int) []string + func StringToInt64(value string) (int64, error) + func StringWithCharset(length int, charset string) string + func TimeInSnowflakeID(id snowflake.ID) time.Time + func TimeInSnowflakeInt(id int64) time.Time + func TimeToCNFormat(t time.Time) string + type AnyMap = map[interface{}]interface + func AnyToAnyMap(value interface{}) AnyMap + type CustomStringConvertable interface + String func() string + type Number interface + type Optional struct + func FlatMapOptional[Wrapped any, Return any](opt Optional[Wrapped], fn func(Wrapped) Optional[Return]) Optional[Return] + func MapOptional[Wrapped any, Return any](opt Optional[Wrapped], fn func(Wrapped) Return) Optional[Return] + func NoneOptional[Wrapped any]() Optional[Wrapped] + func OptionalWithPointer[Wrapped any](v *Wrapped) Optional[Wrapped] + func SomeOptional[Wrapped any](v Wrapped) Optional[Wrapped] + func (this Optional[Wrapped]) Get() Wrapped + func (this Optional[Wrapped]) IsValid() bool + type RWLock struct + func NewRWLock[Value any](v Value) RWLock[Value] + func (self *RWLock[Value]) Read() Value + func (self *RWLock[Value]) ReadFn(op func(v *Value)) + func (self *RWLock[Value]) Write(v Value) + func (self *RWLock[Value]) WriteFn(op func(v *Value)) + type Range struct + func NewClosedRange[Bound Number](lower, upper Bound) Range[Bound] + func NewUpperOpenedRange[Bound Number](lower, upper Bound) Range[Bound] + func (this Range[Bound]) Contains(v Bound) bool + func (this Range[Bound]) IsEmpty() bool + func (this Range[Bound]) WithLowerOpened() Range[Bound] + func (this Range[Bound]) WithUpperOpened() Range[Bound] + type Result struct + func FlatMapResult[Success any, Failure error, NewSuccess any](result Result[Success, Failure], fn func(Success) Result[NewSuccess, Failure]) Result[NewSuccess, Failure] + func MapResult[Success any, Failure error, NewSuccess any](result Result[Success, Failure], fn func(Success) NewSuccess) Result[NewSuccess, Failure] + func ResultWithFailure[Success any, Failure error](e Failure) Result[Success, Failure] + func ResultWithSuccess[Success any, Failure error](v Success) Result[Success, Failure] + func (this Result[Success, Failure]) Failure() Optional[Failure] + func (this Result[Success, Failure]) IsSuccess() bool + func (this Result[Success, Failure]) Success() Optional[Success] + type Set struct + func NewSet[Element comparable](values ...Element) Set[Element] + func (this *Set[Element]) Add(values ...Element) + func (this *Set[Element]) Count() int + func (this *Set[Element]) Remove(values ...Element) + func (this Set[Element]) All() []Element + func (this Set[Element]) Contains(value Element) bool + type StrMap = map[string]interface + func AnyArrayToStrMap(mapInterface []interface{}) StrMap + func AnyToStrMap(value interface{}) StrMap + func FlattenMap(rootKey, delimiter string, originData StrMap) StrMap + type TimeInDay struct + Hour int + Minute int + Second int + func MakeTimeInDay(hour, minute, second int) TimeInDay + func ParseTimeInDay(t string) (inst TimeInDay) + func (t TimeInDay) Compare(other time.Time) int8 + func (t TimeInDay) IsValid() bool + func (t TimeInDay) TimeOnDay(day time.Time) time.Time