Documentation ¶
Index ¶
- Constants
- func CompareVersion(src, toCompare string) bool
- func CompressedContent(h *template.HTML)
- func CopyMap(m map[string]string) map[string]string
- func FileExist(path string) bool
- func FileSize(s uint64) string
- func FindArrayInterface(ds []interface{}, checkor func(interface{}) bool) (int, interface{})
- func FindArrayString(ds []string, checkor func(string) bool) (int, string)
- func ForEache(ds interface{}, next func(interface{}) (bool, error)) (err error)
- func IfBool(condition bool, ifture, ifalse bool) bool
- func IfExec(condition bool, ifture, ifalse func())
- func IfFunc(condition bool, ifture, ifalse func() interface{}) interface{}
- func IfInt(condition bool, ifture, ifalse int) int
- func IfObject(condition bool, ifture, ifalse interface{}) interface{}
- func IfString(condition bool, ifture, ifalse string) 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 ReverseStr(s string) string
- func SplitStrCR(s string, x rune, c int) string
- func TimeSincePro(then time.Time, m map[string]string) string
- func UUID(length int64) string
- func WrapURL(u string) string
- type Collection
- type Handler
Constants ¶
View Source
const ( // Byte byte Byte = 1 // KByte kbyte KByte = Byte * 1024 // MByte mbyte MByte = KByte * 1024 // GByte gbyte GByte = MByte * 1024 // TByte tbyte TByte = GByte * 1024 // PByte pbyte PByte = TByte * 1024 // EByte ebyte 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 ¶
CompareVersion compare version
func CompressedContent ¶
CompressedContent compressed comtent
func FindArrayInterface ¶
FindArrayInterface ...
func FindArrayString ¶
FindArrayString ...
func TimeSincePro ¶
TimeSincePro calculates the time interval and generate full user-friendly string.
Types ¶
type Collection ¶
type Collection []map[string]interface{}
Collection collection
func (Collection) FirstGet ¶
func (c Collection) FirstGet(key string) interface{}
FirstGet first get
func (Collection) Where ¶
func (c Collection) Where(key string, values ...interface{}) Collection
Where filters the collection by a given key / value pair.
Click to show internal directories.
Click to hide internal directories.