Documentation
¶
Index ¶
- func AddTime(unit string, quantity int64, baseTime ...time.Time) time.Time
- func CloneMapToStruct(input any, output interface{}) error
- func Contains[T comparable](slice []T, target T) bool
- func ConvertValueToString(value reflect.Value) string
- func Curve25519Genkey(StdEncoding bool, inputBase64 string) (public, private string, err error)
- func DayDiff(startTime, endTime time.Time) int64
- func DaysToMonthDay(t time.Time, targetDay int) int64
- func DaysToNextMonth(t time.Time) int64
- func DaysToYearDay(t time.Time, month int, day int) int64
- func DeepCopy[T, K any](destStruct T, srcStruct K, opts ...CopyOption) T
- func EncodePassWord(str string) string
- func ExtractVersionNumber(versionStr string) int
- func FormatFloat(num float64, decimal int) string
- func FormatStringToFloat(str string) float64
- func GenerateCipher(serverKey string, length int) string
- func GenerateETag(data []byte) string
- func GenerateShortID(privateKey string) string
- func GenerateTradeNo() string
- func GetLastDayOfMonth(t time.Time) int64
- func GetYearDays(t time.Time, month int, day int) int64
- func Int64SliceToString(intSlice []int64) string
- func Int64SliceToStringSlice(slice []int64) []string
- func Int64ToStringSlice(intSlice []int64) []string
- func IsValidImageSize(base64Str string, maxSizeKB int64) bool
- func MaskEmail(email string) string
- func Md5Encode(str string, isUpper bool) string
- func MicrosecondsStr(elapsed time.Duration) string
- func MonthDiff(startTime, endTime time.Time) int
- func ParseRedisURI(uri string) (addr, password string, database int, err error)
- func RedisPing(addr, password string, database int) error
- func RemoveDuplicateElements[T comparable](input ...T) []T
- func RemoveElementBySlice[T comparable](slice []T, element T) []T
- func RemoveStringElement(arr []string, element ...string) []string
- func RenderTemplateToString(tmpl string, data interface{}) (string, error)
- func ShallowCopy[T, K interface{}](destStruct T, srcStruct K, opts ...CopyOption) T
- func SliceDifferenceInt64(slice1, slice2 []int64) []int64
- func SliceIntersectInt64(slice1, slice2 []int64) []int64
- func SliceIsExistInt64(slice []int64, value int64) bool
- func StringMergeAndRemoveDuplicates(strs ...string) []string
- func StringSliceContains(slice []string, str string) bool
- func StringSliceToInt64Slice(slice []string) []int64
- func StringSliceToString(stringSlice []string) string
- func StringToInt64Slice(s string) []int64
- func SystemConfigSliceReflectToStruct(slice []*system.System, structType any)
- func Tern[T any](cond bool, a, b T) T
- func VerifyPassWord(passwd, EncodePasswd string) bool
- func YearDiff(startTime, endTime time.Time) int
- type CopyOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CloneMapToStruct ¶
func Contains ¶
func Contains[T comparable](slice []T, target T) bool
func ConvertValueToString ¶
ConvertValueToString converts the value to string
func Curve25519Genkey ¶
func DaysToNextMonth ¶
func DeepCopy ¶
func DeepCopy[T, K any](destStruct T, srcStruct K, opts ...CopyOption) T
func EncodePassWord ¶
func ExtractVersionNumber ¶
func FormatFloat ¶
func FormatStringToFloat ¶
func GenerateCipher ¶
GenerateCipher 根据公钥生成固定长度密文
func GenerateETag ¶
func GenerateShortID ¶
func GenerateTradeNo ¶
func GenerateTradeNo() string
func GetLastDayOfMonth ¶
GetLastDayOfMonth 获取指定时间所在月份的最后一天
func Int64SliceToString ¶
func Int64SliceToStringSlice ¶
func Int64ToStringSlice ¶
func IsValidImageSize ¶
IsValidImageSize 检查base64图片是否有效且未超出大小限制 base64Str: base64编码的图片字符串 maxSizeKB: 最大允许大小(KB),int64类型 返回: bool - true表示图片有效且未超限,false表示无效或超限
func MicrosecondsStr ¶
func ParseRedisURI ¶
func RemoveDuplicateElements ¶
func RemoveDuplicateElements[T comparable](input ...T) []T
func RemoveElementBySlice ¶
func RemoveElementBySlice[T comparable](slice []T, element T) []T
func RemoveStringElement ¶ added in v1.0.1
RemoveStringElement 移除指定元素
func RenderTemplateToString ¶
func ShallowCopy ¶
func ShallowCopy[T, K interface{}](destStruct T, srcStruct K, opts ...CopyOption) T
func SliceDifferenceInt64 ¶
SliceDifferenceInt64 returns the difference of two slices
func SliceIntersectInt64 ¶
func SliceIsExistInt64 ¶
SliceIsExistInt64 checks if a value exists in a slice
func StringMergeAndRemoveDuplicates ¶
StringMergeAndRemoveDuplicates Tool function to convert multiple comma separated strings into [] strings and deduplicate them
func StringSliceContains ¶
func StringSliceToInt64Slice ¶
func StringSliceToString ¶
string slice to string
func StringToInt64Slice ¶
func VerifyPassWord ¶
Types ¶
type CopyOption ¶ added in v1.0.1
CopyOption 定义复制选项的函数类型
func CopyWithIgnoreEmpty ¶ added in v1.0.1
func CopyWithIgnoreEmpty(ignoreEmpty bool) CopyOption
CopyWithIgnoreEmpty 设置是否忽略空值
Click to show internal directories.
Click to hide internal directories.