utils

package
v1.3.36 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertFilterValueToFieldType added in v1.3.31

func ConvertFilterValueToFieldType(obj interface{}, filterField string, filterValue string) ([]interface{}, error)

func CopyFile

func CopyFile(sourceFile, destinationFile string) error

func FormatToHtmlTable

func FormatToHtmlTable(titles []string, datas ...any) string

func FormatToSql

func FormatToSql(data interface{}) string

func GenerateKey added in v1.3.31

func GenerateKey() ([]byte, error)

func InArray added in v1.3.30

func InArray[T comparable](x T, ss []T) bool

func InRange added in v1.3.30

func InRange[T comparable](x T, ss ...T) bool

func IsDir

func IsDir(path string) (bool, error)

func MapToStruct

func MapToStruct(m map[string]interface{}, s interface{})

func Md5Sum

func Md5Sum(strToSign string) string

func NewRequestId

func NewRequestId() string

func RandomString

func RandomString(size int) string

func ReadCsvFile

func ReadCsvFile(fileName string, data interface{}, headerRows int) error

func Round

func Round(num float64, digits int) float64

Round 对 float64 进行四舍五入,保留指定的小数位数 digits 表示要保留的小数位数

func StructToMap

func StructToMap(obj interface{}) map[string]string

func StructToMapStrStr

func StructToMapStrStr(input interface{}) map[string]string

func ToSnakeString

func ToSnakeString(s string) string

func ToString

func ToString(a interface{}) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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