Versions in this module Expand all Collapse all v1 v1.4.3 May 11, 2023 v1.4.2 Apr 26, 2023 v1.4.1 Apr 26, 2023 v1.4.0 Apr 26, 2023 v1.3.9 Apr 24, 2023 v1.3.8 Apr 23, 2023 v1.3.7 Apr 23, 2023 Changes in this version + const CryptoHMACSHA256 v1.3.6 Mar 28, 2023 v1.3.5 Mar 27, 2023 Changes in this version + func EraseSyncMap(m *sync.Map) + func Float32ToByte(float float32) []byte + func Float64ToByte(float float64) []byte + func GetExecNameWithoutExt() string + func SignedBytes2Int64(b []byte) int64 + func String2Byte(s string, t int) byte + func String2Float32(s string) float32 + func String2UInt64(s string, t int) uint64 type ConfData + func (c *ConfData) AddOrUpdate(key, value, tip string) + func (c *ConfData) SetFullPath(p string) + type SliceFlag []string + func (f *SliceFlag) Set(value string) error + func (f *SliceFlag) String() string v1.3.4 Jun 16, 2022 v1.3.3 Jun 16, 2022 Changes in this version + const AXIS + const DateOnlyFormat + const DateTimeFormat + const OFFSET + const TimeOnlyFormat + const XPI + func BD09toGCJ02(lon, lat float64) (float64, float64) + func BD09toWGS84(lon, lat float64) (float64, float64) + func Bytes(s string) []byte + func FormatFileSize(fileSize int64) (size string) + func FormatFloat64(f float64, p int) float64 + func GCJ02toBD09(lon, lat float64) (float64, float64) + func GCJ02toWGS84(lon, lat float64) (float64, float64) + func GetExecName() string + func LastSlice(s, sep string) string + func String(b []byte) string + func WGS84toBD09(lon, lat float64) (float64, float64) + func WGS84toGCJ02(lon, lat float64) (float64, float64) + type ArchiveType byte + var ArchiveSnappy ArchiveType = 3 + type ExcelData struct + func NewExcel(filename string) (*ExcelData, error) + func (e *ExcelData) AddRow(cells ...interface{}) + func (e *ExcelData) AddRowInSheet(sheetname string, cells ...interface{}) + func (e *ExcelData) AddSheet(sheetname string) (*xlsx.Sheet, error) + func (e *ExcelData) Save() (string, error) + func (e *ExcelData) SetColume(columeName ...string) + func (e *ExcelData) Write(w io.Writer) error + type Time int64 v1.3.2 Apr 27, 2021 Changes in this version + const ArchiveGZip + const ArchiveZlib + const BColorBlack + const BColorBlue + const BColorCyan + const BColorDefault + const BColorGreen + const BColorMagenta + const BColorRed + const BColorWhite + const BColorYellow + const CryptoAES128CBC + const CryptoAES128CFB + const CryptoAES192CBC + const CryptoAES192CFB + const CryptoAES256CBC + const CryptoAES256CFB + const CryptoHMACSHA1 + const CryptoMD5 + const CryptoSHA256 + const CryptoSHA512 + const FColorBlack + const FColorBlue + const FColorCyan + const FColorDefault + const FColorGreen + const FColorMagenta + const FColorRed + const FColorWhite + const FColorYellow + const FileTimeFormat + const Finals + const FinalsTone + const FinalsTone2 + const FinalsTone3 + const FirstLetter + const Initials + const LongTimeFormat + const Normal + const OSARCH + const OSNAME + const ShortTimeFormat + const TextAntiWhite + const TextFlicker + const TextHighlight + const TextNormal + const TextUnderline + const TextUnvisiable + const Tone + const Tone2 + const Tone3 + var DefaultCacheDir = filepath.Join(GetExecDir(), "..", "cache") + var DefaultConfDir = filepath.Join(GetExecDir(), "..", "conf") + var DefaultLogDir = filepath.Join(GetExecDir(), "..", "log") + func Base64Imgfile(b, f string) error + func Base64URLDecode(data string) ([]byte, error) + func Base64UrlSafeEncode(source []byte) string + func Bcd2Int8(v byte) byte + func Bcd2STime(b []byte) int32 + func BcdBytes2Float64(b []byte, decimal int, unsigned bool) float64 + func BcdBytes2Float64BigOrder(b []byte, decimal int, unsigned bool) float64 + func BcdDT2Stamp(d []byte) int64 + func BlackText(str string) string + func BlueText(str string) string + func Byte2Bytes(v byte, reverse bool) []byte + func Byte2Int32s(v byte, reverse bool) []int32 + func Byte2SignedInt32(b byte) int32 + func Bytes2Float32(b []byte, bigOrder bool) float32 + func Bytes2Float64(b []byte, bigOrder bool) float64 + func Bytes2Int64(b []byte, bigorder bool) int64 + func Bytes2String(data []byte, sep string) string + func Bytes2Uint64(b []byte, bigorder bool) uint64 + func CacheMarshal(v interface{}) ([]byte, error) + func CacheUnmarshal(b []byte, v interface{}) error + func CalcCRC32(b []byte, bigorder bool) []byte + func CalcCRC32String(b []byte) string + func CalculateSecurityCode(t, salt string, offset int) []string + func CheckCrc16VB(d []byte) bool + func CheckCrc16VBBigOrder(d []byte) bool + func CheckIP(ip string) bool + func CheckLrc(d []byte) bool + func CheckRCMru(d []byte) bool + func CheckSQLInject(s string) bool + func CodeString(s string) string + func ColorText(fcolor, bcolor, textstyle int, str string) string + func CompressData(src []byte, t byte) []byte + func CopyFile(src, dst string) (int64, error) + func CountCrc16VB(data *[]byte) []byte + func CountLrc(data *[]byte) byte + func CountRCMru(d []byte) byte + func CyanText(str string) string + func DFM2GPS(du, fen int, miao float64) float64 + func DecodeString(s string) string + func DecodeStringOld(s string) string + func DoZlibCompress(src []byte) []byte + func DoZlibUnCompress(src []byte) []byte + func EncodeUTF16BE(s string) []byte + func ExternalIP() string + func ExternalIPV6() string + func Float642BcdBytes(v float64, f string) []byte + func Float642BcdBytesBigOrder(v float64, f string) []byte + func GPS2DFM(l float64) (int, int, float64) + func GbkToUtf8(s []byte) ([]byte, error) + func GetAddrFromString(straddr string) ([]int64, error) + func GetClientTLSConfig(certfile, keyfile, rootca string) (*tls.Config, error) + func GetExecDir() string + func GetMD5(text string) string + func GetRandomASCII(l int64) []byte + func GetRandomString(l int64) string + func GetServerTLSConfig(certfile, keyfile, clientca string) (*tls.Config, error) + func GetSunriseSunset(latitude float64, longitude float64, utcOffset float64, date time.Time) (sunrise time.Time, sunset time.Time, err error) + func GetTCPPort() (int, error) + func GetUUID1() string + func GlobalIPs() ([]string, []string, error) + func GreenText(str string) string + func HashData(b []byte, cryptoType byte) string + func HexString2Bytes(s string, bigorder bool) []byte + func IP2Int64(ipnr string) int64 + func IP2Uint(ipnr string) uint + func IPInt642Bytes(ipnr int64) []byte + func IPInt642String(ipnr int64) string + func IPUint2Bytes(ipnr int64) []byte + func IPUint2String(ipnr uint) string + func Imgfile2Base64(s string) (string, error) + func Int642Bytes(i int64, bigOrder bool) []byte + func Int82Bcd(v byte) byte + func IsExist(p string) bool + func JSON2PB(js string, pb interface{}) error + func JoinPathFromHere(path ...string) string + func MagentaText(str string) string + func MakeRuntimeDirs(rootpath string) (string, string, string) + func PB2Json(pb interface{}) []byte + func PB2String(pb interface{}) string + func RealIP(v6first bool) string + func RedText(str string) string + func ReverseString(s string) string + func SMSUnicode(s string) []string + func STime2Bcd(t int32) []byte + func SignedInt322Byte(i int32) byte + func SlicesDifference(slice1, slice2 []string) []string + func SlicesIntersect(slice1, slice2 []string) []string + func SlicesUnion(slice1, slice2 []string) []string + func SplitDateTime(sdt int64) (y, m, d, h, mm, s, wd byte) + func SplitStringWithLen(s string, l int) []string + func Stamp2BcdDT(dt int64) []byte + func Stamp2Time(t int64, fmt ...string) string + func String2Bytes(data string, sep string) []byte + func String2Float64(s string) float64 + func String2Int(s string, t int) int + func String2Int32(s string, t int) int32 + func String2Int64(s string, t int) int64 + func String2Int8(s string, t int) byte + func String2Unicode(s string) string + func StringSlice2Int8(bs []string) byte + func SwapCase(s string) string + func SwitchStamp(t int64) int64 + func Time2Stamp(s string) int64 + func Time2StampNB(s string) int64 + func Time2Stampf(s, fmt string, tz float32) int64 + func TrimString(s string) string + func Uint642Bytes(i uint64, bigOrder bool) []byte + func UnZIPFile(archive, target string) error + func UncompressData(src []byte, t byte, dstlen ...interface{}) []byte + func Utf8ToGbk(s []byte) ([]byte, error) + func VersionInfo(p, v, gv, bd, pl, a string) string + func WhiteText(str string) string + func WriteVersionInfo(p, v, gv, bd, pl, a string) + func YellowText(str string) string + func ZIPFile(d, s string, delold bool) error + func ZIPFiles(dstName string, srcFiles []string, newDir string) error + type ArchiveWorker struct + func GetNewArchiveWorker(archiveType byte) *ArchiveWorker + func (a *ArchiveWorker) Compress(src []byte) []byte + func (a *ArchiveWorker) Uncompress(src []byte) []byte + type ConfData struct + func LoadConfig(fullpath string) (*ConfData, error) + func (c *ConfData) Clear() + func (c *ConfData) DelItem(key string) + func (c *ConfData) FullPath() string + func (c *ConfData) GetAll() string + func (c *ConfData) GetItem(key string) (string, error) + func (c *ConfData) GetItemDefault(key, value string, remark ...string) string + func (c *ConfData) GetItemDetail(key string) (string, string, error) + func (c *ConfData) GetKeys() []string + func (c *ConfData) Len() int + func (c *ConfData) Reload() error + func (c *ConfData) Save() error + func (c *ConfData) SetItem(key, value, remark string) bool + func (c *ConfData) UpdateItem(key, value string) bool + type CryptoWorker struct + func GetNewCryptoWorker(cryptoType byte) *CryptoWorker + func (h *CryptoWorker) Decrypt(s string) string + func (h *CryptoWorker) Encrypt(s string) string + func (h *CryptoWorker) EncryptNoTail(s string) string + func (h *CryptoWorker) Hash(b []byte) string + func (h *CryptoWorker) SetKey(key, iv string) error + type Logger interface + Debug func(msgs string) + DebugFormat func(f string, msgs ...interface{}) + DefaultWriter func() io.Writer + Error func(msgs string) + ErrorFormat func(f string, msgs ...interface{}) + Info func(msgs string) + InfoFormat func(f string, msgs ...interface{}) + System func(msgs string) + SystemFormat func(f string, msgs ...interface{}) + Warning func(msgs string) + WarningFormat func(f string, msgs ...interface{}) + func InitNewLogger(p string) Logger + func NewLogger(d, f string, logLevel, logDays int) Logger + type MxLog struct + func (l *MxLog) Debug(msg string) + func (l *MxLog) DebugFormat(f string, msg ...interface{}) + func (l *MxLog) DefaultWriter() io.Writer + func (l *MxLog) Error(msg string) + func (l *MxLog) ErrorFormat(f string, msg ...interface{}) + func (l *MxLog) Info(msg string) + func (l *MxLog) InfoFormat(f string, msg ...interface{}) + func (l *MxLog) System(msg string) + func (l *MxLog) SystemFormat(f string, msg ...interface{}) + func (l *MxLog) Warning(msg string) + func (l *MxLog) WarningFormat(f string, msg ...interface{}) + func (l *MxLog) WriteLog(msg string, level int) + type NilLogger struct + func (l *NilLogger) Debug(msgs string) + func (l *NilLogger) DebugFormat(f string, msg ...interface{}) + func (l *NilLogger) DefaultWriter() io.Writer + func (l *NilLogger) Error(msgs string) + func (l *NilLogger) ErrorFormat(f string, msg ...interface{}) + func (l *NilLogger) Info(msgs string) + func (l *NilLogger) InfoFormat(f string, msg ...interface{}) + func (l *NilLogger) System(msgs string) + func (l *NilLogger) SystemFormat(f string, msg ...interface{}) + func (l *NilLogger) Warning(msgs string) + func (l *NilLogger) WarningFormat(f string, msg ...interface{}) + type Pinyin struct + Hanzi string + Heteronym bool + IgnoreOther bool + Separator string + Style int + func (p *Pinyin) Result() [][]string + func (p *Pinyin) String() string + type Queue struct + func NewQueue() *Queue + func (mq *Queue) Clear() + func (mq *Queue) Empty() bool + func (mq *Queue) Get() interface{} + func (mq *Queue) GetNoDel() interface{} + func (mq *Queue) Len() int64 + func (mq *Queue) Put(value interface{}) + func (mq *Queue) PutFront(value interface{}) + type StdLogger struct + func (l *StdLogger) Debug(msgs string) + func (l *StdLogger) DebugFormat(f string, msg ...interface{}) + func (l *StdLogger) DefaultWriter() io.Writer + func (l *StdLogger) Error(msgs string) + func (l *StdLogger) ErrorFormat(f string, msg ...interface{}) + func (l *StdLogger) Info(msgs string) + func (l *StdLogger) InfoFormat(f string, msg ...interface{}) + func (l *StdLogger) System(msgs string) + func (l *StdLogger) SystemFormat(f string, msg ...interface{}) + func (l *StdLogger) Warning(msgs string) + func (l *StdLogger) WarningFormat(f string, msg ...interface{}) + type StringSliceSort struct + Idx int + OneDimensional []string + Order string + TwoDimensional [][]string + func (arr *StringSliceSort) Len() int + func (arr *StringSliceSort) Less(i, j int) bool + func (arr *StringSliceSort) Swap(i, j int) + type SunrisesetParams struct + Latitude float64 + Longitude float64 + SunResult sync.Map + UtcOffset float64 + Year int + func (p *SunrisesetParams) Calculation() bool + func (p *SunrisesetParams) Get(month, day int) (rise, set int) + type SunrisesetResult struct + Day int + Month int + Sunrise int + Sunset int + type XCache struct + func NewCache(l int64) *XCache + func (xc *XCache) Clear() + func (xc *XCache) Get(k interface{}) (interface{}, bool) + func (xc *XCache) Len() int64 + func (xc *XCache) Set(k, v interface{}, expire int64) bool + func (xc *XCache) SetWithHold(k, v interface{}, expire, timeout int64) bool