helper

package
v0.0.0-...-e78ee98 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: MIT Imports: 38 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DbFs embed.FS
View Source
var IpSearch *xdb.Searcher
View Source
var UapParser *uaparser.Parser

Functions

func Body

func Body(c echo.Context) (*gjson.Result, error)

func CreateDir

func CreateDir(dirs ...string)

func Decryption

func Decryption(str string, keys ...string) (string, error)

func Encryption

func Encryption(str string, keys ...string) (string, error)

func ExcelImport

func ExcelImport(url string) ([][]string, error)

func FileMd5

func FileMd5(data []byte) string

FileMd5 File MD5

func GetTreeNode

func GetTreeNode(data any, id uint, idField string, sonField string) map[string]any

func GetUuid

func GetUuid() (string, error)

GetUuid Get UUID

func HashEncode

func HashEncode(content string) string

HashEncode Ciphertext Encryption

func HashVerify

func HashVerify(hashedPwd string, password string) bool

HashVerify Ciphertext Verification

func HumanFileSize

func HumanFileSize(fileSize int64) (size string)

HumanFileSize Format File Size

func InTimeSpan

func InTimeSpan(start, end, check time.Time, includeStart, includeEnd bool) bool

InTimeSpan Range Time Query

func IpParser

func IpParser(ip string) (string, error)

func IsExist

func IsExist(f string) bool

IsExist Determine if Directory/File Exists

func LcFirst

func LcFirst(str string) string

LcFirst Lowercase the First Letter

func Md5

func Md5(text string) string

Md5 Generate 32-bit MD5

func PageLimit

func PageLimit(page int, total int, limit int) (int, int)

PageLimit Calculation

func Qs

func Qs(c echo.Context) (*gjson.Result, error)

func RandString

func RandString(len int) string

RandString Random Characters

func Round

func Round(val float64, precision int) float64

Round Keep Decimal Places

func SliceToTree

func SliceToTree(data []map[string]any, idField string, pidField string, sonField string) []map[string]any

func UaParser

func UaParser(ua string) (*uaparser.Client, error)

func UcFirst

func UcFirst(str string) string

UcFirst Uppercase the First Letter

func UnzipFiles

func UnzipFiles(filename, path string) error

func VisitIncrement

func VisitIncrement(ctx echo.Context, hasType string, hasID uint, driver string, path string) error

func ZipFiles

func ZipFiles(path, filename string, files []string, rootPath string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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