Documentation
¶
Index ¶
- Variables
- func Base64Encode(str string) string
- func Bytes2String(b []byte) string
- func Dir() string
- func Exist(file string) bool
- func GetBetweenStr(str, start, end string) string
- func GetExistPath(path string) string
- func InSlice(v string, sl []string) bool
- func InSliceIface(v interface{}, sl []interface{}) bool
- func InSliceIfaceToLower(v string, sl interface{}) (bool, error)
- func InterfacesToStrings(items []interface{}) (s []string)
- func Keys(maps map[string]interface{}) []string
- func ListDir(path string) ([]string, error)
- func Max(a, b int) int
- func MaxFloat64(a, b float64) float64
- func Md5Encode(str string) string
- func Merge(mapsA map[string]string, mapsB map[string]string) (map[string]string, error)
- func Min(a, b int) int
- func MinFloat64(a, b float64) float64
- func MkDir(path string) error
- func MkDirIfNotExist(path string) error
- func Path() string
- func Pwd() string
- func RandSleep(max, min int)
- func RemoveDir(path string) error
- func RemoveFile(file string) error
- func ReplayMaxStr(size int) string
- func ReplayStr(i int, size int) string
- func SStrings(param []string) map[string]bool
- func SearchFile(filename string, paths ...string) (fullpath string, err error)
- func SliceDiff(slice1, slice2 []interface{}) (diffslice []interface{})
- func SliceFilter(slice []interface{}, a filtertype) (ftslice []interface{})
- func SliceMerge(slice1, slice2 []interface{}) (c []interface{})
- func SliceRand(a []interface{}) (b interface{})
- func SliceRandList(min, max int) []int
- func SliceRange(start, end, step int64) (intslice []int64)
- func SliceReduce(slice []interface{}, a reducetype) (dslice []interface{})
- func SliceShuffle(slice []interface{}) []interface{}
- func SliceSum(intslice []int64) (sum int64)
- func Sort(maps map[string]string) map[string]string
- func SortKey(maps []string) []string
- func String2Bytes(s string) []byte
- func Strings(param []interface{}) map[string]bool
- func Substr(str string, start, length int) string
- func ToMapStrings(param map[string]interface{}) map[string]string
- func ToParam(param url.Values) map[string]string
- func ToSlice(arr interface{}) ([]interface{}, error)
- func ToStringDict(items []interface{}, key string) ([]string, error)
- func ToStrings(arr []interface{}) []string
- func ToTime(str string) (time.Time, error)
- func ToValues(param map[string]string) url.Values
- func Uint16Decode(src []byte) uint16
- func Uint16Encode(dst []byte, u uint16) []byte
- func Urldecode(str string) (string, error)
- func Urlencode(str string) string
- func Values(maps map[string]interface{}) []interface{}
- func Version_compare(version1, version2 string) int
- func WildcardMatch(pattern, name string) bool
- func WildcardMatchSimple(pattern, name string) bool
- type Duration
- type TimerPool
- type Timestamp
Constants ¶
This section is empty.
Variables ¶
var ( MININTSTR string = "0000000000000000000000" MAXINTSTR string = "9999999999999999999999" )
Functions ¶
func Base64Encode ¶
func Bytes2String ¶ added in v1.4.0
Bytes2String converts a byte slice to a string without memory allocation. WARNING: the returned string shares the underlying memory with the byte slice. Do NOT modify the input slice while the returned string is in use. For safe conversion, use string(b) instead.
func GetBetweenStr ¶
func GetExistPath ¶
func InSliceIface ¶
func InSliceIface(v interface{}, sl []interface{}) bool
func InSliceIfaceToLower ¶
func InterfacesToStrings ¶
func InterfacesToStrings(items []interface{}) (s []string)
func MaxFloat64 ¶
func MinFloat64 ¶
func MkDirIfNotExist ¶
func RemoveFile ¶
func ReplayMaxStr ¶
func SliceFilter ¶
func SliceFilter(slice []interface{}, a filtertype) (ftslice []interface{})
func SliceMerge ¶
func SliceMerge(slice1, slice2 []interface{}) (c []interface{})
func SliceRandList ¶
func SliceRange ¶
func SliceReduce ¶
func SliceReduce(slice []interface{}, a reducetype) (dslice []interface{})
func SliceShuffle ¶
func SliceShuffle(slice []interface{}) []interface{}
SliceShuffle shuffles a slice using Fisher-Yates algorithm. NOTE: This uses math/rand which is not cryptographically secure. Do not use for security-sensitive shuffling (e.g., token generation).
func String2Bytes ¶ added in v1.4.0
String2Bytes converts a string to a byte slice without memory allocation. WARNING: the returned slice shares the underlying memory with the string. Do NOT modify the returned slice, as it may corrupt the original string. For safe conversion, use []byte(s) instead.
func ToMapStrings ¶
func ToStringDict ¶
func Uint16Decode ¶ added in v1.1.1
func Uint16Encode ¶ added in v1.1.1
func Values ¶
func Values(maps map[string]interface{}) []interface{}
Values returns all values from the map as a slice.
func Version_compare ¶
Usage
Utils.CompareSimple("1.2", "1.0.1")
Returns: 1
Utils.CompareSimple("1.0rc1", "1.0")
Returns: -1
func WildcardMatch ¶
func WildcardMatchSimple ¶
Types ¶
type TimerPool ¶ added in v1.1.1
type TimerPool struct {
// contains filtered or unexported fields
}
func NewTimerPool ¶ added in v1.1.1
func NewTimerPool() *TimerPool