Versions in this module Expand all Collapse all v1 v1.1.3 Oct 6, 2024 Changes in this version + func GetAllIPAdress() string + func GetAllMacAdress() string v1.1.2 May 29, 2024 v1.1.1 May 25, 2024 v1.1.0 May 4, 2024 v1.0.9 Nov 25, 2023 Changes in this version + func IsNetClose(err error) bool v1.0.8 Oct 13, 2023 v1.0.7 Oct 10, 2023 v1.0.6 Oct 10, 2023 v1.0.4 Oct 10, 2023 v1.0.3 Oct 10, 2023 Changes in this version + func IsAddrInUse(err error) bool v1.0.1 Oct 9, 2023 v1.0.0 Oct 3, 2023 Changes in this version + const ObjectGUIDAttribute + var DateFormat string = "2006-01-02" + var DateTimeFormat string = "2006-01-02 15:04:05" + var ErrInvalidID = errors.New("无效的ID") + var MyTitle = ... + var TimeFormat string = "15:04:05" + var TimeLocation *time.Location + func AesDecrypt(key, test_str string) (string, error) + func AesEncrypt(key, test_str string) (string, error) + func Base64Decode(test_str string) (string, error) + func Base64Encode(test_str string) string + func DosName(str string) string + func FileIsExist(filename string) bool + func GetCallStack() (level int, stack string, file string, line int) + func GetCurrentPath() string + func GetDebugStack() string + func GetFileBaseName(path string) string + func GetFileDir(path string) string + func GetFileExt(path string) string + func GetFileExtName(path string) string + func GetFileModTime(filename string) (time.Time, error) + func GetFileName(path string) string + func GetFileRealPath(path string) string + func GetFileSize(filename string) int64 + func GetFloatSize(fBytes float64) string + func GetFullFileName(filename string) string + func GetIPAdress() string + func GetInt64Size(iBytes int64) string + func GetIntSize(iBytes int) string + func GetJson(object interface{}) string + func GetLastYear() time.Time + func GetMapByBool(mapi map[string]string, name string, default_value bool) bool + func GetMapByInt(mapi map[string]string, name string, default_value int) int + func GetMapByString(mapi map[string]string, name, default_value string) string + func GetNetError(err error) string + func GetNow() time.Time + func GetShowKey(key string) string + func GetShowPassword(password string) string + func GetStatusCode(resp *http.Response) int + func GetStringSize(sBytes string) string + func GetTimeAgo(t time.Time) string + func GetTimeText(fBytes int) string + func GetUInt64Size(iBytes uint64) string + func IIF(b bool, t, f interface{}) interface + func IIFByTime(flag bool, A, B time.Time) time.Time + func IIFbyInt(flag bool, A, B int) int + func IIFbyString(flag bool, A, B string) string + func If(condition bool, trueVal, falseVal interface{}) interface + func IsAscii(text_str string) bool + func IsChinese(str string) bool + func IsDir(filename string) (bool, error) + func IsExeFile(path string) (bool, error) + func IsHanZi(text_str string) bool + func IsNumber(text_str string) bool + func LoadFileText(file_name string) (string, error) + func LoadJson(json_file string, save_object interface{}) error + func Md5(test_str string) string + func Mkdir(path string) error + func ParseTemplateFile(wr io.Writer, tplname string, data interface{}) error + func ParseTemplates(wr io.Writer, tplname string, data interface{}) error + func ReadMachineID(size int) []byte + func Round(val float64, places int) float64 + func RunFileName() string + func RunPathName() string + func SQLExecDDL(db_in *sql.DB, run_sql string, ignore bool) (err error) + func SQLGetValue(db_in *sql.DB, query_sql string, v ...interface{}) (interface{}, error) + func SQLGetValueByInt(db_in *sql.DB, query_sql string, v ...interface{}) (bool, int, error) + func SQLGetValueByString(db_in *sql.DB, query_sql string, v ...interface{}) (string, error) + func SQLGetValueByTime(db_in *sql.DB, query_sql string, v ...interface{}) (time.Time, error) + func SQLGetValues(db_in *sql.DB, query_sql string, v ...interface{}) ([]interface{}, error) + func SQLPrepared(db_in *sql.DB, query_sql string, v ...any) ([]*sql.ColumnType, error) + func SQLQuery(db_in *sql.DB, query_sql string, v ...interface{}) ([][]string, error) + func SQLQueryPrint(db_in *sql.DB, query_sql string, v ...interface{}) error + func SQLRowPrintByResult(query *sql.Rows) error + func SQLRunByInsert(db_in *sql.DB, run_sql string, v ...interface{}) (int64, error) + func SQLRunByUpdate(db_in *sql.DB, run_sql string, v ...interface{}) (int64, error) + func SaveJson(json_file string, save_object interface{}) error + func SetJson(json_text string, save_object interface{}) error + func SetRunFileName(file string) string + func StringToTime(data_str string) (time.Time, error) + func StringToTimeByTemplates(tm, templates string) (time.Time, error) + func Substr(str string, start, length int) string + func TxRunByInsert(db_in *sql.Tx, run_sql string, v ...interface{}) (int64, error) + func TxRunByUpdate(db_in *sql.Tx, run_sql string, v ...interface{}) (int64, error) + type Glimit struct + func SetNumGoroutine(n int) *Glimit + func (g *Glimit) Run(f func()) + type ISingleton interface + GetSingleton func() (interface{}, error) + func NewSingleton(init SingletonInitFunc) ISingleton + type JsonTime time.Time + func (Self JsonTime) FromString(data string) error + func (Self JsonTime) MarshalJSON() ([]byte, error) + func (Self JsonTime) ToString() string + func (Self JsonTime) UnmarshalJSON(data []byte, v interface{}) error + type SingletonInitFunc func() (interface{}, error) + type TAESEncrypt struct + IV []byte + Key []byte + ZeroPad bool + func (this *TAESEncrypt) Decrypt(ciphertext string) ([]byte, error) + func (this *TAESEncrypt) Encrypt(strMesg string) ([]byte, error) + func (this *TAESEncrypt) Init(key_str string) + func (this *TAESEncrypt) PKCS5Padding(ciphertext []byte, blockSize int) []byte + func (this *TAESEncrypt) PKCS5UnPadding(ciphertext []byte, blockSize int) []byte + func (this *TAESEncrypt) ZeroPadding(ciphertext []byte, blockSize int) []byte + func (this *TAESEncrypt) ZeroUnPadding(ciphertext []byte, blockSize int) []byte + type TGUID struct + Data1 uint32 + Data2 uint16 + Data3 uint16 + Data4 [8]byte + func GUIDFromBytes(bs []byte) TGUID + func GUIDFromString(s string) (TGUID, error) + func GUIDFromWindowsArray(b [16]byte) TGUID + func (g TGUID) OctetString() string + func (g TGUID) String() string + func (g TGUID) ToWindowsArray() [16]byte + type TLruCache struct + func NewLruCache(maxSize int) *TLruCache + func (this *TLruCache) ClearAll() + func (this *TLruCache) Delete(key string) + func (this *TLruCache) Get(key string) interface{} + func (this *TLruCache) IsExist(key string) bool + func (this *TLruCache) Len() int + func (this *TLruCache) Set(key string, val interface{}, timeout int64) + type TSingleton struct + func (s *TSingleton) GetSingleton() (interface{}, error) + type TSize float64 + const EB + const GB + const KB + const MB + const PB + const TB + func (b TSize) String() string + type TStack struct + Element []string + func NewStack() *TStack + func (stack *TStack) Empty() bool + func (stack *TStack) Find(value string) bool + func (stack *TStack) Get(idx int) (value interface{}) + func (stack *TStack) Pop() (err error) + func (stack *TStack) PopByValue(value string) (err error) + func (stack *TStack) Print() + func (stack *TStack) Push(value string) + func (stack *TStack) Set(idx int, value string) (err error) + func (stack *TStack) Size() int + func (stack *TStack) Swap(other *TStack) + func (stack *TStack) Top() (value string) + type TUUID [rawLen]byte + func NewUUID() *TUUID + func UUIDFromString(id string) (*TUUID, error) + func (id *TUUID) UnmarshalText(text []byte) error + func (id TUUID) GetMachine() []byte + func (id TUUID) GetPID() uint16 + func (id TUUID) GetTime() time.Time + func (id TUUID) MarshalText() ([]byte, error) + func (id TUUID) String() string