Documentation ¶
Index ¶
- Constants
- func AorB(condition bool, a, b string) string
- func ByteCountIEC(b int) string
- func CompareVersion(src, toCompare string) bool
- func CompressedHTML(h *template.HTML)
- func CopyMap(m map[string]string) map[string]string
- func DownloadTo(url, output string) error
- func FileExist(path string) bool
- func FileSize(s uint64) string
- func GetParentDirectory(directory string) string
- func InArray(arr []string, str string) bool
- func IsDirectory(filename string) bool
- func IsFile(filename string) bool
- func IsHiddenFile(name string) bool
- func IsJSON(str string) bool
- func JSON(a interface{}) string
- func MkFileIfNotExist(path string)
- func MkdirIfNotExist(path string)
- func NormalizeEOL(input []byte) []byte
- func PackageName(v interface{}) string
- func ParseBool(s string) bool
- func ParseFileContentType(fileName string) string
- func ParseFloat32(f string) float32
- func ParseHTML(name, tmpl string, param interface{}) template.HTML
- func ParseText(name, tmpl string, param interface{}) string
- func ParseTime(stringTime string) time.Time
- func Random(strings []string) ([]string, error)
- func ReplaceAll(s string, oldnew ...string) string
- func ReplaceNth(s, old, new string, n int) string
- func SetDefault(value, condition, def string) string
- func Substr(s string, pos, length int) string
- func TimeSincePro(then time.Time, m map[string]string) string
- func UnzipDir(src, dest string) error
- func UploadFileTo(fh *multipart.FileHeader, destDirectory string) (int64, error)
- 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 ByteCountIEC ¶
func CompareVersion ¶
func CompressedHTML ¶
func DownloadTo ¶
func GetParentDirectory ¶
func IsDirectory ¶
func IsHiddenFile ¶
func MkFileIfNotExist ¶
func MkFileIfNotExist(path string)
func MkdirIfNotExist ¶
func MkdirIfNotExist(path string)
func NormalizeEOL ¶
NormalizeEOL will convert Windows (CRLF) and Mac (CR) EOLs to UNIX (LF)
func PackageName ¶
func PackageName(v interface{}) string
func ParseFileContentType ¶
func ParseFloat32 ¶
func ReplaceAll ¶
func ReplaceNth ¶
func SetDefault ¶
func TimeSincePro ¶
TimeSincePro calculates the time interval and generate full user-friendly string.
func UploadFileTo ¶
func UploadFileTo(fh *multipart.FileHeader, destDirectory string) (int64, error)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.