Documentation ¶
Index ¶
- Constants
- func CompareVersion(src, toCompare string) bool
- func CompressedContent(h *template.HTML)
- func CopyMap(m map[string]string) map[string]string
- func FileSize(s uint64) string
- func InArray(arr []string, str string) bool
- func IsJSON(str string) bool
- func JSON(a interface{}) string
- func ParseBool(s string) bool
- func ParseFloat32(f string) float32
- func Random(strings []string) ([]string, error)
- func ReplaceNth(s, old, new string, n int) string
- func SetDefault(value, condition, def string) string
- func TimeSincePro(then time.Time, m map[string]string) string
- func Uuid(length int64) string
- func WrapURL(u string) string
Constants ¶
View Source
const ( Byte = 1 KByte = Byte * 1024 MByte = KByte * 1024 GByte = MByte * 1024 TByte = GByte * 1024 PByte = TByte * 1024 EByte = PByte * 1024 )
View Source
const ( Minute = 60 Hour = 60 * Minute Day = 24 * Hour Week = 7 * Day Month = 30 * Day Year = 12 * Month )
Seconds-based time units
Variables ¶
This section is empty.
Functions ¶
func CompareVersion ¶ added in v1.2.9
func CompressedContent ¶ added in v1.1.7
func FileSize ¶ added in v1.2.9
FileSize calculates the file size and generate user-friendly string.
func ParseFloat32 ¶ added in v1.2.9
func ReplaceNth ¶ added in v1.2.3
func SetDefault ¶ added in v1.2.9
func TimeSincePro ¶ added in v1.2.9
TimeSincePro calculates the time interval and generate full user-friendly string.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.