Documentation ¶
Index ¶
- func CreateDir(dirs ...string)
- func Decryption(str string, keys ...string) (string, error)
- func Encryption(str string, keys ...string) (string, error)
- func FileMd5(data []byte) string
- func FormatData[T any](data []T, call func(item T, index int) map[string]any, page *Pagination) ([]map[string]any, map[string]any)
- func FormatFileSize(fileSize int64) (size string)
- func GetTreeNode(data any, id uint, idField string, sonField string) map[string]any
- func GetUuid() (string, error)
- func HashEncode(content string) string
- func HashVerify(hashedPwd string, password string) bool
- func InTimeSpan(start, end, check time.Time, includeStart, includeEnd bool) bool
- func IsExist(f string) bool
- func LcFirst(str string) string
- func Md5(text string) string
- func PageLimit(page int, total int, limit int) (int, int)
- func Paginate(pagination *Pagination) func(db *gorm.DB) *gorm.DB
- func RandString(len int) string
- func Round(val float64, precision int) float64
- func SliceToTree(data []map[string]any, idField string, pidField string, sonField string) []map[string]any
- func UcFirst(str string) string
- type Pagination
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatData ¶
func FormatFileSize ¶
FormatFileSize Format File Size
func GetTreeNode ¶
func HashVerify ¶
HashVerify Ciphertext Verification
func InTimeSpan ¶
InTimeSpan Range Time Query
func SliceToTree ¶
Types ¶
type Pagination ¶
type Pagination struct { PageSize int `json:"pageSize,omitempty"` Page int `json:"page,omitempty"` Total int64 `json:"total"` Pages int `json:"pages"` }
func NewPagination ¶
func NewPagination(page, pageSize int) *Pagination
func (*Pagination) GetLimit ¶
func (p *Pagination) GetLimit() int
func (*Pagination) GetOffset ¶
func (p *Pagination) GetOffset() int
func (*Pagination) GetPage ¶
func (p *Pagination) GetPage() int
Click to show internal directories.
Click to hide internal directories.