Documentation ¶
Index ¶
- func AlignStringMappingArrayFields(data []map[string]string) []map[string]string
- func ChannelAsyncPush[T any](ch chan T, data T)
- func Chunk[T any](data []T, size uint) (result [][]T)
- func Cmd(c CmdOption) (result []byte, err error)
- func CompareSlice[T comparable](value1, value2 []T) bool
- func CopyStringMapping(data map[string]string) (result map[string]string)
- func CopyStringMappingArray(data []map[string]string) (result []map[string]string)
- func EmbeddingCos(vector1, vector2 []float64) float64
- func EnvToBool(name string, value bool) bool
- func EnvToInt(name string, value int) int
- func EnvToString(name string, value string) string
- func GetCurrentDir() string
- func GetFieldValue(field string, data interface{}) interface{}
- func GetFieldValues(field string, data interface{}) []interface{}
- func GroupBy[T any, P comparable](data []T, key func(item T) (P, bool)) (result map[P][]T)
- func InArray[T comparable](array []T, data T) (result bool)
- func InArrayFloat64(data float64, array []float64) bool
- func InArrayInt(data int, array []int) bool
- func InArrayString(data string, array []string) bool
- func IsBool(value interface{}) bool
- func IsDir(f string) bool
- func IsEmpty(value interface{}) bool
- func IsExistsPath(f string) bool
- func IsFloat(value interface{}) bool
- func IsInt(value interface{}) bool
- func IsMap(value interface{}) bool
- func IsNil(value interface{}, traceSource ...bool) bool
- func IsNumber(s string) bool
- func IsSlice(value interface{}) bool
- func IsString(value interface{}) bool
- func IsStruct(value interface{}) bool
- func IsUint(value interface{}) bool
- func KeyBy[T any, P comparable](data []T, key func(item T) (P, bool)) (result map[P]T)
- func Mapping[T any, K, V comparable](data []T, f func(item T) (K, V)) (result map[K]V)
- func Md5(data []byte) string
- func MkDirAll(f string, perm os.FileMode) (err error)
- func OrderBy[T any](data []T, compare func(first, second T) (result bool))
- func Pluck[T any, P comparable](array []T, key func(item T) P) (result []P)
- func PrintMemory(ctx context.Context, interval int64, ...)
- func RandomInt(min, max int) int
- func RandomStr(length int, randomType RandomType) string
- func ReplaceAll(src string, old []string, new string) string
- func SHA1(data string) string
- func ToBool(s string) bool
- func ToCamel(data string) string
- func ToCamelWithChars(data string, chars []string) string
- func ToFloat32(s string) float32
- func ToFloat64(s string) float64
- func ToInt(s string) int
- func ToInt32(s string) int32
- func ToInt64(s string) int64
- func ToInt8(s string) int8
- func ToSnake(data string) string
- func ToSnakeWithChar(data string, r rune) string
- func ToString(data interface{}) string
- func ToUint(s string) uint
- func ToUint32(s string) uint32
- func ToUint64(s string) uint64
- func ToUint8(s string) uint8
- func TrimPath(p string) string
- func Ucfirst(s string) string
- func Unique[T comparable](data []T) []T
- func Zip(src string, dest string, ignores ...string) error
- type CmdOption
- type MemoryStatus
- type NumberType
- type RandomType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChannelAsyncPush ¶ added in v0.0.52
func ChannelAsyncPush[T any](ch chan T, data T)
func CompareSlice ¶ added in v0.1.13
func CompareSlice[T comparable](value1, value2 []T) bool
func CopyStringMappingArray ¶
func EmbeddingCos ¶ added in v0.0.52
EmbeddingCos 使用cosine计算向量相似度
func EnvToString ¶
func GetCurrentDir ¶ added in v0.0.52
func GetCurrentDir() string
func GetFieldValue ¶ added in v0.0.52
func GetFieldValue(field string, data interface{}) interface{}
func GetFieldValues ¶ added in v0.0.52
func GetFieldValues(field string, data interface{}) []interface{}
func GroupBy ¶ added in v0.0.52
func GroupBy[T any, P comparable](data []T, key func(item T) (P, bool)) (result map[P][]T)
func InArray ¶ added in v0.0.52
func InArray[T comparable](array []T, data T) (result bool)
InArray 数组是否存在该值
func InArrayFloat64 ¶
InArrayFloat64 判断是否在数组中,float64
func InArrayString ¶
InArrayString 判断是否在数组中,string
func IsFloat ¶ added in v0.0.7
func IsFloat(value interface{}) bool
IsFloat checks whether `value` is type of float.
func IsMap ¶ added in v0.0.7
func IsMap(value interface{}) bool
IsMap checks whether `value` is type of map.
func IsSlice ¶ added in v0.0.7
func IsSlice(value interface{}) bool
IsSlice checks whether `value` is type of slice.
func IsStruct ¶ added in v0.0.7
func IsStruct(value interface{}) bool
IsStruct checks whether `value` is type of struct.
func IsUint ¶ added in v0.0.7
func IsUint(value interface{}) bool
IsUint checks whether `value` is type of uint.
func KeyBy ¶ added in v0.0.52
func KeyBy[T any, P comparable](data []T, key func(item T) (P, bool)) (result map[P]T)
func Mapping ¶ added in v0.1.16
func Mapping[T any, K, V comparable](data []T, f func(item T) (K, V)) (result map[K]V)
func Pluck ¶ added in v0.0.52
func Pluck[T any, P comparable](array []T, key func(item T) P) (result []P)
func PrintMemory ¶ added in v0.0.52
func RandomStr ¶
func RandomStr(length int, randomType RandomType) string
func ReplaceAll ¶
ReplaceAll 多个字符串同时替换为同一个
func ToCamelWithChars ¶ added in v0.0.52
func ToSnakeWithChar ¶ added in v0.0.52
func Unique ¶ added in v0.0.52
func Unique[T comparable](data []T) []T
Types ¶
type MemoryStatus ¶ added in v0.0.52
type NumberType ¶ added in v0.0.12
type NumberType uint8
const ( UInt NumberType = iota Int UFloat Float Positive Negative All )
type RandomType ¶
type RandomType uint8
const ( RandomType_All RandomType = iota RandomType_Number RandomType_Char RandomType_LowerChar RandomType_UpperChar RandomType_Symbol RandomType_NumberAndSymbol RandomType_CharAndSymbol )
Click to show internal directories.
Click to hide internal directories.