{"modulePath":"github.com/GoAdminGroup/go-admin","version":"v1.2.26","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package utils\n\n## Constants\n\n```go\nconst (\n\tByte  = 1\n\tKByte = Byte * 1024\n\tMByte = KByte * 1024\n\tGByte = MByte * 1024\n\tTByte = GByte * 1024\n\tPByte = TByte * 1024\n\tEByte = PByte * 1024\n)\n```\n\n```go\nconst (\n\tMinute = 60\n\tHour   = 60 * Minute\n\tDay    = 24 * Hour\n\tWeek   = 7 * Day\n\tMonth  = 30 * Day\n\tYear   = 12 * Month\n)\n```\nSeconds-based time units\n\n## Functions\n\n```go\nfunc AorB(condition bool, a, b string) string\n```\n\n```go\nfunc CompareVersion(src, toCompare string) bool\n```\n\n```go\nfunc CompressedContent(h *template.HTML)\n```\n\n```go\nfunc CopyMap(m map[string]string) map[string]string\n```\n\n```go\nfunc DownloadTo(url, output string) error\n```\n\n```go\nfunc FileExist(path string) bool\n```\n\n```go\nfunc FileSize(s uint64) string\n```\nFileSize calculates the file size and generate user-friendly string.\n\n```go\nfunc InArray(arr []string, str string) bool\n```\n\n```go\nfunc IsJSON(str string) bool\n```\n\n```go\nfunc JSON(a interface{}) string\n```\n\n```go\nfunc PackageName(v interface{}) string\n```\n\n```go\nfunc ParseBool(s string) bool\n```\n\n```go\nfunc ParseFloat32(f string) float32\n```\n\n```go\nfunc ParseHTML(name, tmpl string, param interface{}) template.HTML\n```\n\n```go\nfunc ParseText(name, tmpl string, param interface{}) string\n```\n\n```go\nfunc ParseTime(stringTime string) time.Time\n```\n\n```go\nfunc Random(strings []string) ([]string, error)\n```\n\n```go\nfunc ReplaceAll(s string, oldnew ...string) string\n```\n\n```go\nfunc ReplaceNth(s, old, new string, n int) string\n```\n\n```go\nfunc SetDefault(value, condition, def string) string\n```\n\n```go\nfunc TimeSincePro(then time.Time, m map[string]string) string\n```\nTimeSincePro calculates the time interval and generate full user-friendly string.\n\n```go\nfunc UnzipDir(src, dest string) error\n```\n\n```go\nfunc Uuid(length int64) string\n```\n\n```go\nfunc WrapURL(u string) string\n```\n\n","path":"github.com/GoAdminGroup/go-admin/modules/utils","name":"utils","synopsis":"","isRedistributable":true}
