Versions in this module Expand all Collapse all v1 v1.0.2 Nov 28, 2024 v1.0.0 Aug 3, 2023 Changes in this version + const IS_GO_TEST + const Is32BitPlatform + const Is64BitPlatform + var DEFAULT_PID_FILE = "log/PID" + func AESCBCDecrypt(cipherkey, ciphertext []byte, useBase64 ...bool) ([]byte, error) + func AESCBCEncrypt(cipherkey, plaintext []byte, useBase64 ...bool) []byte + func AESCTRDecrypt(cipherkey, ciphertext []byte, useBase64 ...bool) ([]byte, error) + func AESCTREncrypt(cipherkey, plaintext []byte, useBase64 ...bool) []byte + func AESDecrypt(cipherkey, ciphertext []byte, useBase64 ...bool) ([]byte, error) + func AESEncrypt(cipherkey, plaintext []byte, useBase64 ...bool) []byte + func AddrInt(i int) *int + func BytesToString(b []byte) string + func CamelString(s string) string + func CodePointToUTF8(str string, base int) string + func CopyDir(src string, dst string) error + func CopyFile(src, dst string) error + func CopyStrings(a []string) []string + func DereferenceIfaceValue(v reflect.Value) reflect.Value + func DereferenceImplementType(v reflect.Value) reflect.Type + func DereferencePtrValue(v reflect.Value) reflect.Value + func DereferenceSlice(v reflect.Value) reflect.Value + func DereferenceType(t reflect.Type) reflect.Type + func DereferenceValue(v reflect.Value) reflect.Value + func ExtranetIP() (ip string, err error) + func FileExist(name string) (existed bool, isDir bool) + func FileExists(name string) (existed bool) + func FilepathAbsolute(paths []string) ([]string, error) + func FilepathAbsoluteMap(paths []string) (map[string]string, error) + func FilepathContains(basepath string, subpaths []string) error + func FilepathDistinct(paths []string, toAbs bool) ([]string, error) + func FilepathFromSlash(paths []string) []string + func FilepathRelative(basepath string, targpaths []string) ([]string, error) + func FilepathRelativeMap(basepath string, targpaths []string) (map[string]string, error) + func FilepathSame(path1, path2 string) (bool, error) + func FilepathSlashInsensitive(path string) string + func FilepathSplitExt(filename string, slashInsensitive ...bool) (root, ext string) + func FilepathStem(filename string, slashInsensitive ...bool) string + func FilepathToSlash(paths []string) []string + func Fnv1aToUint32(b []byte) uint32 + func Fnv1aToUint64(b []byte) uint64 + func GetCallLine(calldepth int) string + func GetFirstGopath(allowAutomaticGuessing bool) (gopath string, err error) + func GetGopaths() []string + func GrepFile(patten string, filename string) (lines []string, err error) + func HTMLEntityToUTF8(str string, base int) string + func Indent(text, prefix string) string + func InitAndGetString(strPtr *string, def string) string + func InitPointer(v reflect.Value) bool + func Int32sDistinct(a []int32) (set []int32) + func Int64sDistinct(a []int64) (set []int64) + func InterfacesDistinct(a []interface{}) (set []interface{}) + func IntersectStrings(set1, set2 []string) []string + func IntranetIP() (string, error) + func IntsDistinct(a []int) (set []int) + func IsCompositionMethod(method reflect.Method) bool + func IsExportedName(name string) bool + func IsExportedOrBuiltinType(t reflect.Type) bool + func IsGoTest() bool + func IsLittleEndian() bool + func JsQueryEscape(s string) string + func JsQueryUnescape(s string) (string, error) + func LintCamelString(name string) string + func Md5(b []byte) string + func MkdirAll(path string, perm ...os.FileMode) error + func ObjectName(obj interface{}) string + func PanicTrace(kb int) []byte + func RandomBytes(n int) []byte + func ReferenceSlice(v reflect.Value, ptrDepth int) reflect.Value + func ReferenceType(t reflect.Type, ptrDepth int) reflect.Type + func ReferenceValue(v reflect.Value, ptrDepth int) reflect.Value + func RelPath(targpath string) string + func RemoveAllFromInt32s(set []int32, a int32) []int32 + func RemoveAllFromInt64s(set []int64, a int64) []int64 + func RemoveAllFromInterfaces(set []interface{}, a interface{}) []interface + func RemoveAllFromInts(set []int, a int) []int + func RemoveAllFromStrings(set []string, a string) []string + func RemoveFromInt32s(set []int32, a int32) []int32 + func RemoveFromInt64s(set []int64, a int64) []int64 + func RemoveFromInterfaces(set []interface{}, a interface{}) []interface + func RemoveFromInts(set []int, a int) []int + func RemoveFromStrings(set []string, a string) []string + func ReplaceFile(filename string, start, end int, newContent string) error + func RewriteFile(filename string, fn func(content []byte) (newContent []byte, err error)) error + func RewriteToFile(filename, newfilename string, ...) error + func SearchFile(filename string, paths ...string) (fullpath string, err error) + func SelfChdir() + func SelfDir() string + func SelfPath() string + func SetToInt32s(set []int32, a int32) []int32 + func SetToInt64s(set []int64, a int64) []int64 + func SetToInterfaces(set []interface{}, a interface{}) []interface + func SetToInts(set []int, a int) []int + func SetToStrings(set []string, a ...string) []string + func Sha1(b []byte) string + func Sha256(b []byte) string + func Sha512(b []byte) string + func SnakeString(s string) string + func SpaceInOne(s string) string + func StringMarshalJSON(s string, escapeHTML bool) []byte + func StringToBytes(s string) []byte + func StringsConvert(a []string, fn func(string) (string, error)) ([]string, error) + func StringsConvertMap(a []string, fn func(string) (string, error)) (map[string]string, error) + func StringsDistinct(a []string) (set []string) + func StringsToBools(a []string, emptyAsZero ...bool) ([]bool, error) + func StringsToFloat32s(a []string, emptyAsZero ...bool) ([]float32, error) + func StringsToFloat64s(a []string, emptyAsZero ...bool) ([]float64, error) + func StringsToInt16s(a []string, emptyAsZero ...bool) ([]int16, error) + func StringsToInt32s(a []string, emptyAsZero ...bool) ([]int32, error) + func StringsToInt64s(a []string, emptyAsZero ...bool) ([]int64, error) + func StringsToInt8s(a []string, emptyAsZero ...bool) ([]int8, error) + func StringsToInts(a []string, emptyAsZero ...bool) ([]int, error) + func StringsToUint16s(a []string, emptyAsZero ...bool) ([]uint16, error) + func StringsToUint32s(a []string, emptyAsZero ...bool) ([]uint32, error) + func StringsToUint64s(a []string, emptyAsZero ...bool) ([]uint64, error) + func StringsToUint8s(a []string, emptyAsZero ...bool) ([]uint8, error) + func StringsToUints(a []string, emptyAsZero ...bool) ([]uint, error) + func TarGz(src, dst string, includePrefix bool, logOutput func(string, ...interface{}), ...) (err error) + func TarGzTo(src string, dstWriter io.Writer, includePrefix bool, ...) (err error) + func URLRandomString(n int) string + func WalkDirs(targpath string, suffixes ...string) (dirlist []string) + func WriteFile(filename string, data []byte, perm ...os.FileMode) error + func WritePidFile(pidFile ...string) + type KVData map[string]interface + func (k KVData) Get(key string) (value interface{}, exists bool) + func (k KVData) GetBool(key string) (b bool) + func (k KVData) GetDuration(key string) (d time.Duration) + func (k KVData) GetFloat64(key string) (f64 float64) + func (k KVData) GetInt(key string) (i int) + func (k KVData) GetInt64(key string) (i64 int64) + func (k KVData) GetString(key string) (s string) + func (k KVData) GetStringMap(key string) (sm map[string]interface{}) + func (k KVData) GetStringMapString(key string) (sms map[string]string) + func (k KVData) GetStringMapStringSlice(key string) (smss map[string][]string) + func (k KVData) GetStringSlice(key string) (ss []string) + func (k KVData) GetTime(key string) (t time.Time) + func (k KVData) MustGet(key string) interface{} + type Map interface + Clear func() + Delete func(key interface{}) + Len func() int + Load func(key interface{}) (value interface{}, ok bool) + LoadOrStore func(key, value interface{}) (actual interface{}, loaded bool) + Random func() (key, value interface{}, exist bool) + Range func(f func(key, value interface{}) bool) + Store func(key, value interface{}) + func AtomicMap() Map + func RwMap(capacity ...int) Map + type Random struct + func NewRandom(alphabet string) *Random + func URLRandom() *Random + func (r *Random) ParseTime(stringWithTime string) (unixTs int64, err error) + func (r *Random) RandomString(length int) string + func (r *Random) RandomStringWithTime(length int, unixTs int64) (string, error)