Documentation ¶
Index ¶
- Constants
- func AbsInt(a int) int
- func AbsInt64(a int64) int64
- func AmountToCny(val string) string
- func Base64(bts []byte) string
- func Base64Decode(str string) ([]byte, error)
- func Base64Encode(bts []byte) string
- func BoolToString(b bool) string
- func BytesToReader(bts []byte) io.Reader
- func BytesToString(b []byte) string
- func BytesToUint32(bytes []byte) uint32
- func BytesToUint64(bytes []byte) uint64
- func CamelToUnderline(str string) string
- func Compress(srcBytes []byte) []byte
- func Contains(str string, substr string) bool
- func ContainsIngoreCase(str string, substr string) bool
- func CopyDir(srcDir, dstDir string) error
- func CopyFile(srcFilePath string, dstFilePath string) error
- func CreateShortcutFile(targetFile string, shortcutLnkFile string) error
- func DbFieldName(name string) string
- func DbTableName(name string) string
- func Debug(v ...any)
- func DecodeRsa(str string, priKey string) (string, error)
- func DecodeRsaByPriFile(str string, pubKeyFileName string) (string, error)
- func DecodeRsaBytes(cipherText, privateKey []byte) ([]byte, error)
- func DecodeRsaBytesByPriFile(data []byte, privateKeyFileName string) ([]byte, error)
- func EncodeRsa(str string, pubKey string) (string, error)
- func EncodeRsaByPubFile(str string, pubKeyFileName string) (string, error)
- func EncodeRsaBytes(data []byte, publicKey []byte) ([]byte, error)
- func EncodeRsaBytesByPubFile(data []byte, pubKeyFileName string) ([]byte, error)
- func Endwiths(str string, endstr string) bool
- func EqualsIngoreCase(str1 string, str2 string) bool
- func Error(v ...any)
- func ExecCmd(command string) (stdout, stderr string, err error)
- func ExecTime(fn func()) int64
- func FasthttpPostJson(url string, jsondata string, headers ...string) ([]byte, error)
- func FileExtName(name string) string
- func FileName(name string) string
- func Float64ToCny(val float64) string
- func Float64ToInt64(f float64) int64
- func Float64ToString(num float64) string
- func Float64ToStringRoundDown(num float64, digit int32) string
- func FormatAmountRound(num float64, digit int32) string
- func FormatDate(date time.Time, fmt DateFormat) string
- func FormatRound(num float64, digit int32) string
- func FormatSystemDate(fmt DateFormat) string
- func GbkToUtf8(gbk []byte) []byte
- func GenerateRSAKey(keySize int) (privateKey []byte, publicKey []byte, err error)
- func GenerateRsaKey() error
- func GenerateRsaKeyFile(keySize int, priKeyFile, pubKeyFile string) error
- func GetCityByIp(ip string) string
- func GetEnvBool(name string, defaultValue ...bool) bool
- func GetEnvInt(name string, defaultValue ...int) int
- func GetEnvStr(name string, defaultValue ...string) string
- func GetHtmlText(strHtml string) string
- func GetLocalHostName() string
- func GetLocalIp() string
- func GetTypeOfStructPointer(structPointer any) (reflect.Type, error)
- func GetTypeOfStructSlicePointer(structSlicePointer any) (reflect.Type, error)
- func GetUserHomeDir() string
- func GetUserStartupDir() string
- func GetYyyymmdd(addDays int) string
- func Gzip(srcFile string, gzipFile string) error
- func Hash(str string) uint32
- func HashCode(bts []byte) uint32
- func HashMod(str string, mod uint32) uint32
- func HashString(str string) string
- func HexToRgb(hex string) (rgb []int)
- func HostsAddDomain(ip string, domain string) error
- func HttpDownload(url, saveAsPathFile string) error
- func HttpGetJson(url string, headers ...string) ([]byte, error)
- func HttpPostForm(url string, formMap map[string]string, headers ...string) ([]byte, error)
- func HttpPostJson(url string, jsondata string, headers ...string) ([]byte, error)
- func HttpUploadFile(url string, filePath string, headers ...string) ([]byte, error)
- func ImgBlur(srcFile string, distFile string, sigma float64) error
- func ImgBmpToJpg(buf []byte, o *jpeg.Options) []byte
- func ImgCompress(buf []byte, maxWidth uint, maxHeight uint, o *jpeg.Options) []byte
- func ImgResize(srcFile string, distFile string, maxWidth uint, maxHeight uint, ...)
- func IndexOf(str string, substr string) int
- func Info(v ...any)
- func Int64ToBytes(i int64) []byte
- func Int64ToString(i int64) string
- func IntToBytes(intNum int) []byte
- func IntToExcelColumn(iCol int) string
- func IntToString(i int) string
- func IsAlpha(s string) bool
- func IsAlphaDigit(s string) bool
- func IsAlpine() bool
- func IsBlank(str string) bool
- func IsDigit(s string) bool
- func IsEmail(str string) bool
- func IsExistDir(dir string) bool
- func IsExistFile(file string) bool
- func IsFullWidth(s string) bool
- func IsHalfWidth(s string) bool
- func IsIPv4(str string) bool
- func IsIPv6(str string) bool
- func IsIdCard(idCard string) bool
- func IsIp(str string) bool
- func IsLinux() bool
- func IsMac() bool
- func IsMobile(phone string) bool
- func IsNumber(s string) bool
- func IsTypeOfArray(v any) bool
- func IsTypeOfBool(v any) bool
- func IsTypeOfChan(v any) bool
- func IsTypeOfComplex128(v any) bool
- func IsTypeOfComplex64(v any) bool
- func IsTypeOfFloat32(v any) bool
- func IsTypeOfFloat64(v any) bool
- func IsTypeOfFunc(v any) bool
- func IsTypeOfInt(v any) bool
- func IsTypeOfInt16(v any) bool
- func IsTypeOfInt32(v any) bool
- func IsTypeOfInt64(v any) bool
- func IsTypeOfInt8(v any) bool
- func IsTypeOfInterface(v any) bool
- func IsTypeOfMap(v any) bool
- func IsTypeOfPointer(v any) bool
- func IsTypeOfSlice(v any) bool
- func IsTypeOfString(v any) bool
- func IsTypeOfStruct(v any) bool
- func IsTypeOfUint(v any) bool
- func IsTypeOfUint16(v any) bool
- func IsTypeOfUint32(v any) bool
- func IsTypeOfUint64(v any) bool
- func IsTypeOfUint8(v any) bool
- func IsTypeOfUintptr(v any) bool
- func IsTypeOfUnsafePointer(v any) bool
- func IsWin() bool
- func Join(elems []string, sep string) string
- func Lcs(s1 string, s2 string) string
- func Left(str string, length int) string
- func Len(str string) int
- func MapToStruct(mapFrom map[string]any, objPtrTo any)
- func Md5(bts []byte) string
- func Md5File(pathfile string) string
- func MeasureCPU() (physicalCount int, logicalCount int, usePercent float64)
- func MeasureDisk() (total uint64, used uint64, free uint64, usePercent float64)
- func MeasureDisks() []*disk.UsageStat
- func MeasureHost() (*host.InfoStat, error)
- func MeasureMemory() (total uint64, used uint64, free uint64, usePercent float64)
- func MeasureSummary() (cpuUsedPercent float64, memUsedPercent float64, diskUsedPercent float64)
- func MeasureSwap() (total uint64, used uint64, free uint64, usePercent float64)
- func Now() string
- func OfMap(kvs ...any) map[string]any
- func OnExit(fnExit func())
- func PadLeft(str string, pad string, length int) string
- func PadRight(str string, pad string, length int) string
- func ParseDate(date string, fmt DateFormat) (time.Time, error)
- func ParseStructFieldType(structType reflect.Type) map[string]string
- func ParseStructType(obj any) (reflect.Type, error)
- func PathSeparator() string
- func Println(v ...any)
- func RadomUint32() uint32
- func RandomHashString() string
- func RandomInt(min, max int) int
- func RandomString(length int) string
- func RandomUint32() uint32
- func RandomUint64() uint64
- func ReadBytesFromStream(stream network.Stream) ([]byte, error)
- func ReadFileBytes(filename string) ([]byte, error)
- func ReadFileString(filename string) (string, error)
- func ReaderToBytes(ioReader io.Reader) []byte
- func RemoveAllFile(pathorfile string) error
- func Repeat(str string, count int) string
- func Replace(str string, old string, new string, n int) string
- func ReplaceAll(str string, old string, new string) string
- func ReplaceAllSpace(str string, new string) string
- func Retry(callback func() error, retryTimes int, duration time.Duration) (err error)
- func Reverse(str string) string
- func RgbToHex(r int, g int, b int) string
- func Right(str string, length int) string
- func Round(num float64, digit int32) float64
- func Round1(num float64) float64
- func Round2(num float64) float64
- func RoundDown(num float64, digit int32) float64
- func SetLogCenterClient(glcClient *GLogCenterClient)
- func SetLogLevel(level string)
- func Split(str string, sep string) []string
- func SshCmd(host string, port string, user string, password string, cmd ...string) (string, error)
- func Startwiths(str string, startstr string) bool
- func String2Float64(s string, defaultVal float64) float64
- func StringToBool(s string, defaultVal bool) bool
- func StringToBytes(s string) []byte
- func StringToInt(s string, defaultVal int) int
- func StringToInt64(s string, defaultVal int64) int64
- func StringToUint32(s string, defaultVal uint32) uint32
- func StructToMap(obj any) map[string]any
- func SubString(str string, start int, end int) string
- func TarDir(directory string, tarfilename string) error
- func Titlelize(str string) string
- func ToLower(str string) string
- func ToUpper(str string) string
- func Today() string
- func Trim(str string) string
- func TrimPrefix(str string, prefix string) string
- func ULID() string
- func Uint16ToBytes(num uint16) []byte
- func Uint32ToBytes(num uint32) []byte
- func Uint32ToString(num uint32) string
- func Uint64ToBytes(num uint64) []byte
- func Uint64ToString(i uint64) string
- func UnCompress(snappyEncodedBytes []byte) []byte
- func UnGzip(gzipPathFile string, destPath string) error
- func UnTar(tarFile string, dist string) error
- func UnZip(zipFile string, destPath string) error
- func UnderlineToCamel(str string) string
- func Unique(strs []string) []string
- func Utf8ToGbk(utf8 []byte) []byte
- func WaitExit(fnExit func())
- func Warn(v ...any)
- func WriteBytesToStream(stream network.Stream, dataBytes []byte) error
- func WriteFileBytes(filename string, data []byte) error
- func WriteFileString(filename string, content string) error
- func Zip(srcFileOrPath string, zipPathFile string) error
- type AesEcb
- type BaiduOcr
- type DateFormat
- type DbHandle
- func (d *DbHandle) BeginTransaction()
- func (d *DbHandle) Commit() error
- func (d *DbHandle) Count(sql string, params ...any) int
- func (d *DbHandle) Delete(deleter *SqlDeleter) int64
- func (d *DbHandle) EndTransaction() error
- func (d *DbHandle) Err() error
- func (d *DbHandle) Execute(sql string, params ...any) int64
- func (d *DbHandle) FindFloat64(sql string, params ...any) float64
- func (d *DbHandle) FindInt(sql string, params ...any) int
- func (d *DbHandle) FindList(structSlicePtr any, sql string, params ...any)
- func (d *DbHandle) FindMap(entity any, sql string, params ...any) map[string]any
- func (d *DbHandle) FindMaps(entity any, sql string, params ...any) []map[string]any
- func (d *DbHandle) FindOne(structPtr any, sql string, params ...any) bool
- func (d *DbHandle) FindString(sql string, params ...any) string
- func (d *DbHandle) FindTime(sql string, params ...any) time.Time
- func (d *DbHandle) FindValue(sql string, params ...any) *DbValue
- func (d *DbHandle) Insert(entity any) int64
- func (d *DbHandle) IsAutoCommit() bool
- func (d *DbHandle) Rollback() error
- func (d *DbHandle) Update(updater *SqlUpdater) int64
- type DbOption
- type DbValue
- type EventBus
- type EventHandler
- type FasthttpServer
- func (f *FasthttpServer) BeforeRequestHandle(beforeHandle GlobalBeforeRequestHandler) *FasthttpServer
- func (f *FasthttpServer) EnableTsl(certData []byte, keyData []byte) *FasthttpServer
- func (f *FasthttpServer) FinallyRequestHandle(finallyHandle GlobalBeforeRequestHandler) *FasthttpServer
- func (f *FasthttpServer) Handle(method string, path string, handle fasthttp.RequestHandler) *FasthttpServer
- func (f *FasthttpServer) HandleGet(path string, handle fasthttp.RequestHandler) *FasthttpServer
- func (f *FasthttpServer) HandleNotFound(handle fasthttp.RequestHandler) *FasthttpServer
- func (f *FasthttpServer) HandlePost(path string, handle fasthttp.RequestHandler) *FasthttpServer
- func (f *FasthttpServer) SetPort(port string) *FasthttpServer
- func (f *FasthttpServer) SetServer(server *fasthttp.Server) *FasthttpServer
- func (f *FasthttpServer) Shutdown() error
- func (f *FasthttpServer) Start() error
- type GLogCenterClient
- func (g *GLogCenterClient) Debug(v ...any)
- func (g *GLogCenterClient) DebugSys(system string, v ...any)
- func (g *GLogCenterClient) Error(v ...any)
- func (g *GLogCenterClient) ErrorSys(system string, v ...any)
- func (g *GLogCenterClient) Fatal(v ...any)
- func (g *GLogCenterClient) FatalSys(system string, v ...any)
- func (g *GLogCenterClient) Info(v ...any)
- func (g *GLogCenterClient) InfoSys(system string, v ...any)
- func (g *GLogCenterClient) Println(text string)
- func (g *GLogCenterClient) Trace(v ...any)
- func (g *GLogCenterClient) TraceSys(system string, v ...any)
- func (g *GLogCenterClient) Warn(v ...any)
- func (g *GLogCenterClient) WarnSys(system string, v ...any)
- type GlcOptions
- type GlobalBeforeRequestHandler
- type JWT
- func (j *JWT) CreateToken(mapKv MapString, exp time.Duration) (string, error)
- func (j *JWT) IsExpired(token string) (bool, error)
- func (j *JWT) NewToken(username string) (string, error)
- func (j *JWT) Parse(token string) (MapString, error)
- func (j *JWT) RefreshToken(token string, exp time.Duration) (string, error)
- func (j *JWT) Validate(token string) (MapString, error)
- type LevelDB
- type LogDataModel
- type Map
- type MapString
- type Minio
- type OptionLevelDB
- type P2pRelayHost
- func (p *P2pRelayHost) ConnectHost(hostAddr string) error
- func (p *P2pRelayHost) ConnectRelayHost(relayHostAddr string) error
- func (p *P2pRelayHost) HostInfo() string
- func (p *P2pRelayHost) RequestWithTimeout(targetHostAddr string, uri string, dataBytes []byte, timeout time.Duration) ([]byte, error)
- func (p *P2pRelayHost) SetStreamHandler(uri string, handler network.StreamHandler)
- type Queue
- type Redis6Client
- type SqlDeleter
- func (d *SqlDeleter) And(column string, param any) *SqlDeleter
- func (d *SqlDeleter) Build() (string, []any)
- func (d *SqlDeleter) Delete(tableName string) *SqlDeleter
- func (d *SqlDeleter) Eq(column string, param any) *SqlDeleter
- func (d *SqlDeleter) Ge(column string, param any) *SqlDeleter
- func (d *SqlDeleter) GetParameters() []any
- func (d *SqlDeleter) GetSql() string
- func (d *SqlDeleter) Gt(column string, param any) *SqlDeleter
- func (d *SqlDeleter) In(column string, params ...any) *SqlDeleter
- func (d *SqlDeleter) IsNotNull(column string) *SqlDeleter
- func (d *SqlDeleter) IsNull(column string) *SqlDeleter
- func (d *SqlDeleter) Le(column string, param any) *SqlDeleter
- func (d *SqlDeleter) LeftLike(column string, param string) *SqlDeleter
- func (d *SqlDeleter) Like(column string, param string) *SqlDeleter
- func (d *SqlDeleter) Lt(column string, param any) *SqlDeleter
- func (d *SqlDeleter) NotEq(column string, param any) *SqlDeleter
- func (d *SqlDeleter) NotIn(column string, params ...any) *SqlDeleter
- func (d *SqlDeleter) NotLike(column string, param string) *SqlDeleter
- func (d *SqlDeleter) Or(column string, param any) *SqlDeleter
- func (d *SqlDeleter) OrEq(column string, param any) *SqlDeleter
- func (d *SqlDeleter) OrGe(column string, param any) *SqlDeleter
- func (d *SqlDeleter) OrGt(column string, param any) *SqlDeleter
- func (d *SqlDeleter) OrLe(column string, param any) *SqlDeleter
- func (d *SqlDeleter) OrLt(column string, param any) *SqlDeleter
- func (d *SqlDeleter) OrNotEq(column string, param any) *SqlDeleter
- func (d *SqlDeleter) RightLike(column string, param string) *SqlDeleter
- func (d *SqlDeleter) Where(column string, param any) *SqlDeleter
- type SqlInserter
- type SqlSelector
- func (d *SqlSelector) And(cond string, params ...any) *SqlSelector
- func (d *SqlSelector) Append(appendSql string, params ...any) *SqlSelector
- func (d *SqlSelector) Build() (string, []any)
- func (d *SqlSelector) Eq(column string, param any) *SqlSelector
- func (d *SqlSelector) From(table string, alias ...string) *SqlSelector
- func (d *SqlSelector) Ge(column string, param any) *SqlSelector
- func (d *SqlSelector) GetParameters() []any
- func (d *SqlSelector) GetSql() string
- func (d *SqlSelector) Gt(column string, param any) *SqlSelector
- func (d *SqlSelector) In(column string, params ...any) *SqlSelector
- func (d *SqlSelector) IsNotNull(column string) *SqlSelector
- func (d *SqlSelector) IsNull(column string) *SqlSelector
- func (d *SqlSelector) Join(table string, alias ...string) *SqlSelector
- func (d *SqlSelector) Le(column string, param any) *SqlSelector
- func (d *SqlSelector) LeftLike(column string, param string) *SqlSelector
- func (d *SqlSelector) Like(column string, param string) *SqlSelector
- func (d *SqlSelector) Lt(column string, param any) *SqlSelector
- func (d *SqlSelector) NotEq(column string, param any) *SqlSelector
- func (d *SqlSelector) NotIn(column string, params ...any) *SqlSelector
- func (d *SqlSelector) NotLike(column string, param string) *SqlSelector
- func (d *SqlSelector) On(onCond string) *SqlSelector
- func (d *SqlSelector) Or(cond string, params ...any) *SqlSelector
- func (d *SqlSelector) OrEq(column string, param any) *SqlSelector
- func (d *SqlSelector) OrGe(column string, param any) *SqlSelector
- func (d *SqlSelector) OrGt(column string, param any) *SqlSelector
- func (d *SqlSelector) OrLe(column string, param any) *SqlSelector
- func (d *SqlSelector) OrLt(column string, param any) *SqlSelector
- func (d *SqlSelector) OrNotEq(column string, param any) *SqlSelector
- func (d *SqlSelector) OrderBy(orders ...string) *SqlSelector
- func (d *SqlSelector) RightLike(column string, param string) *SqlSelector
- func (d *SqlSelector) Select(columns ...string) *SqlSelector
- func (d *SqlSelector) Where(cond string, params ...any) *SqlSelector
- type SqlUpdater
- func (d *SqlUpdater) And(column string, param any) *SqlUpdater
- func (d *SqlUpdater) Build() (string, []any)
- func (d *SqlUpdater) Eq(column string, param any) *SqlUpdater
- func (d *SqlUpdater) Ge(column string, param any) *SqlUpdater
- func (d *SqlUpdater) GetParameters() []any
- func (d *SqlUpdater) GetSql() string
- func (d *SqlUpdater) Gt(column string, param any) *SqlUpdater
- func (d *SqlUpdater) In(column string, params ...any) *SqlUpdater
- func (d *SqlUpdater) IsNotNull(column string) *SqlUpdater
- func (d *SqlUpdater) IsNull(column string) *SqlUpdater
- func (d *SqlUpdater) Le(column string, param any) *SqlUpdater
- func (d *SqlUpdater) LeftLike(column string, param string) *SqlUpdater
- func (d *SqlUpdater) Like(column string, param string) *SqlUpdater
- func (d *SqlUpdater) Lt(column string, param any) *SqlUpdater
- func (d *SqlUpdater) NotEq(column string, param any) *SqlUpdater
- func (d *SqlUpdater) NotIn(column string, params ...any) *SqlUpdater
- func (d *SqlUpdater) NotLike(column string, param string) *SqlUpdater
- func (d *SqlUpdater) Or(column string, param any) *SqlUpdater
- func (d *SqlUpdater) OrEq(column string, param any) *SqlUpdater
- func (d *SqlUpdater) OrGe(column string, param any) *SqlUpdater
- func (d *SqlUpdater) OrGt(column string, param any) *SqlUpdater
- func (d *SqlUpdater) OrLe(column string, param any) *SqlUpdater
- func (d *SqlUpdater) OrLt(column string, param any) *SqlUpdater
- func (d *SqlUpdater) OrNotEq(column string, param any) *SqlUpdater
- func (d *SqlUpdater) RightLike(column string, param string) *SqlUpdater
- func (d *SqlUpdater) Set(column string, param any) *SqlUpdater
- func (d *SqlUpdater) SetMap(m map[string]any) *SqlUpdater
- func (d *SqlUpdater) Update(tableName string) *SqlUpdater
- func (d *SqlUpdater) Where(column string, param any) *SqlUpdater
- type TokenizerJiebago
- type TokenizerSego
Constants ¶
const ( FMT_MM_DD = "MM-dd" FMT_YYYYMM = "yyyyMM" FMT_YYYY_MM = "yyyy-MM" FMT_YYYY_MM_DD = "yyyy-MM-dd" FMT_YYYYMMDD = "yyyyMMdd" FMT_YYYYMMDDHHMMSS = "yyyyMMddHHmmss" FMT_YYYYMMDDHHMM = "yyyyMMddHHmm" FMT_YYYYMMDDHH = "yyyyMMddHH" FMT_YYMMDDHHMM = "yyMMddHHmm" FMT_MM_DD_HH_MM = "MM-dd HH:mm" FMT_MM_DD_HH_MM_SS = "MM-dd HH:mm:ss" FMT_YYYY_MM_DD_HH_MM = "yyyy-MM-dd HH:mm" FMT_YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss" FMT_YYYY_MM_DD_HH_MM_SS_SSS = "yyyy-MM-dd HH:mm:ss.SSS" FMT_MM_DD_EN = "MM/dd" FMT_YYYY_MM_EN = "yyyy/MM" FMT_YYYY_MM_DD_EN = "yyyy/MM/dd" FMT_MM_DD_HH_MM_EN = "MM/dd HH:mm" FMT_MM_DD_HH_MM_SS_EN = "MM/dd HH:mm:ss" FMT_YYYY_MM_DD_HH_MM_EN = "yyyy/MM/dd HH:mm" FMT_YYYY_MM_DD_HH_MM_SS_EN = "yyyy/MM/dd HH:mm:ss" FMT_YYYY_MM_DD_HH_MM_SS_SSS_EN = "yyyy/MM/dd HH:mm:ss.SSS" FMT_MM_DD_CN = "MM月dd日" FMT_YYYY_MM_CN = "yyyy年MM月" FMT_YYYY_MM_DD_CN = "yyyy年MM月dd日" FMT_MM_DD_HH_MM_CN = "MM月dd日 HH:mm" FMT_MM_DD_HH_MM_SS_CN = "MM月dd日 HH:mm:ss" FMT_YYYY_MM_DD_HH_MM_CN = "yyyy年MM月dd日 HH:mm" FMT_YYYY_MM_DD_HH_MM_SS_CN = "yyyy年MM月dd日 HH:mm:ss" FMT_HH_MM = "HH:mm" FMT_HH_MM_SS = "HH:mm:ss" FMT_HH_MM_SS_MS = "HH:mm:ss.SSS" )
日期格式模板
Variables ¶
This section is empty.
Functions ¶
func AmountToCny ¶
金额数字转人民币大写(最大支持千万亿,小数只精确到分,分以下舍去。超过支持的最大值时原样返回不转换)
1234567890123456.789 -> 壹仟贰佰叁拾肆万伍仟陆佰柒拾捌亿玖仟零壹拾贰万叁仟肆佰伍拾陆元柒角捌分 -1234567890123456.78 -> 负壹仟贰佰叁拾肆万伍仟陆佰柒拾捌亿玖仟零壹拾贰万叁仟肆佰伍拾陆元柒角捌分 12345.7 -> 壹万贰仟叁佰肆拾伍元柒角整 12345.0 -> 壹万贰仟叁佰肆拾伍元整 12345 -> 壹万贰仟叁佰肆拾伍元整 9002300040 -> 玖拾亿零贰佰叁拾万零肆拾元整 9002300043.0 -> 玖拾亿零贰佰叁拾万零肆拾叁元整 12345678901234567.781 -> 12345678901234567.781
func CreateShortcutFile ¶ added in v0.7.9
生成指定文件的快捷文件
func DecodeRsaByPriFile ¶
按Base64解码字符串后使用私钥文件进行RSA解密
func DecodeRsaBytesByPriFile ¶
使用私钥文件进行RSA解密
func EncodeRsaByPubFile ¶
使用公钥文件进行RSA加密后按Base64编码字符串
func EncodeRsaBytesByPubFile ¶
使用公钥文件进行RSA加密
func FasthttpPostJson ¶
使用Fasthttp进行Post请求,固定Content-Type:application/json;charset=UTF-8,其他自定义headers格式为 K:V
func Float64ToStringRoundDown ¶
float64 转 string,保留指定位数小数,后续小数位舍去
Float64ToStringRoundDown(1234567890123456,2) -> 1234567890123456.00 Float64ToStringRoundDown(999999999999.999,2) -> 999999999999.99
func FormatAmountRound ¶
float64 转 string,整数部分3位一撇,四舍五入保留或补足指定位数小数
func FormatRound ¶
float64 转 string,四舍五入保留或补足指定位数小数
func GenerateRSAKey ¶
创建秘钥
func GenerateRsaKeyFile ¶
创建秘钥文件(keySize通常是1024、2048、4096)
func GetTypeOfStructPointer ¶
反射解析出结构体类型 参数仅接受:结构体对象指针
func GetTypeOfStructSlicePointer ¶
反射解析出结构体类型 参数仅接受:结构体对象切片指针
func GetUserHomeDir ¶ added in v0.7.9
func GetUserHomeDir() string
func GetUserStartupDir ¶ added in v0.7.9
func GetUserStartupDir() string
func HexToRgb ¶
颜色转换(HEX => RGB)
rgb := HexToRgb("ccc") // rgb: [204 204 204] rgb := HexToRgb("aabbcc") // rgb: [170 187 204] rgb := HexToRgb("#aabbcc") // rgb: [170 187 204] rgb := HexToRgb("0xad99c0") // rgb: [170 187 204]
func HostsAddDomain ¶ added in v0.7.8
在 C:/Windows/System32/drivers/etc/hosts 中添加指定映射
func HttpGetJson ¶
使用标准包进行Get请求,固定Content-Type:application/json;charset=UTF-8,其他自定义headers格式为 K:V
func HttpPostForm ¶
使用标准包进行Post请求,固定Content-Type:application/x-www-form-urlencoded,其他自定义headers格式为 K:V
func HttpPostJson ¶
使用标准包进行Post请求,固定Content-Type:application/json;charset=UTF-8,其他自定义headers格式为 K:V
func HttpUploadFile ¶ added in v0.7.8
使用标准包进行Post请求,固定Content-Type:multipart/form-data,其他自定义headers格式为 K:V
func ImgCompress ¶
图片有损压缩 maxWidth:压缩后的最大宽度 maxHeight:压缩后的最大高度 o:压缩比例(nil时为默认80%)
func ImgResize ¶
图片有损压缩(压缩失败时原样保存至目标文件) srcFile:压缩前文件 distFile:压缩后文件 maxWidth:压缩后的最大宽度 maxHeight:压缩后的最大高度 o:压缩比例(nil时为默认80%)
func Lcs ¶
最长公共子串 参考 http://en.wikibooks.org/wiki/Algorithm_Implementation/Strings/Longest_common_substring
func MapToStruct ¶
func MeasureDisk ¶
检测磁盘(当前盘)
func MeasureMemory ¶
检测内存
func MeasureSummary ¶
检测CPU、内存、磁盘使用占比
func MeasureSwap ¶
检测虚拟内存
func ParseStructType ¶
反射解析出结构体类型 参数仅接受:结构体对象、结构体对象指针、结构体对象切片、结构体对象切片指针
func ReadBytesFromStream ¶ added in v0.9.2
func ReaderToBytes ¶ added in v0.7.6
io.Reader 转 []byte
func ReplaceAllSpace ¶ added in v0.7.8
全部替换连续的空白
func StringToUint32 ¶
字符串(10进制无符号整数形式)转uint32,超过uint32最大值会丢失精度,转换失败时返回默认值
func StructToMap ¶
func ULID ¶
func ULID() string
ULID
ULID常作为UUID的替代方案,固定26位长度(10位时间戳+16位随机数),适用于数据库ID。 主要特点:毫秒精度有序(仅同一毫秒内无序)、无特殊字符
func WriteBytesToStream ¶ added in v0.9.2
func WriteFileBytes ¶
写文件(指定目录不存在时先创建,不含目录时存当前目录)
func WriteFileString ¶
写文件(指定目录不存在时先创建,不含目录时存当前目录)
Types ¶
type AesEcb ¶
type AesEcb struct {
// contains filtered or unexported fields
}
对称加密结构体
func (*AesEcb) DecodeBytes ¶
字节数组解密
type BaiduOcr ¶
type BaiduOcr struct {
// contains filtered or unexported fields
}
func NewBaiduOcr ¶
创建百度OCR对象(参数apiKey和secretKey在百度注册应用后获取)
func (*BaiduOcr) QuotaInvoice ¶
定额发票识别,支持png/jpeg/jpg/bpm/pdf类型(返回JSON识别结果)
支持对各类定额发票的发票代码、发票号码、金额、发票所在地、发票金额小写、省、市7个关键字段进行结构化识别
func (*BaiduOcr) VatInvoice ¶
增值税发票识别,支持png/jpeg/jpg/bpm/pdf类型(返回JSON识别结果)
支持对增值税普票、专票、卷票、电子发票的所有字段进行结构化识别, 包括发票基本信息、销售方及购买方信息、商品信息、价税信息等,其中四要素识别准确率超过 99.9%; 同时,支持对增值税卷票的 21 个关键字段进行识别,包括发票类型、发票代码、发票号码、机打号码、 机器编号、收款人、销售方名称、销售方纳税人识别号、开票日期、购买方名称、购买方纳税人识别号、 项目、单价、数量、金额、税额、合计金额(小写)、合计金额(大写)、校验码、省、市,四要素平均识别准确率可达95%以上。
type DbHandle ¶
type DbHandle struct {
// contains filtered or unexported fields
}
数据库控制器
func (*DbHandle) EndTransaction ¶
结束事务(未曾出错时提交,否则回滚),失败时返回错误
func (*DbHandle) FindFloat64 ¶
查找单记录的单个字段值,出错时panic
func (*DbHandle) FindString ¶
查找单记录的单个字段值,出错时panic
type EventBus ¶
type EventBus struct {
// contains filtered or unexported fields
}
事件总线结构体
type FasthttpServer ¶
type FasthttpServer struct {
// contains filtered or unexported fields
}
Fasthttp服务器结构体
func (*FasthttpServer) BeforeRequestHandle ¶
func (f *FasthttpServer) BeforeRequestHandle(beforeHandle GlobalBeforeRequestHandler) *FasthttpServer
注册全局前置拦截器(前置拦截器返回true时才会继续正常处理后续请求)
func (*FasthttpServer) EnableTsl ¶ added in v0.7.8
func (f *FasthttpServer) EnableTsl(certData []byte, keyData []byte) *FasthttpServer
开启TSL
func (*FasthttpServer) FinallyRequestHandle ¶ added in v0.7.11
func (f *FasthttpServer) FinallyRequestHandle(finallyHandle GlobalBeforeRequestHandler) *FasthttpServer
注册全局后置拦截器
func (*FasthttpServer) Handle ¶
func (f *FasthttpServer) Handle(method string, path string, handle fasthttp.RequestHandler) *FasthttpServer
注册指定方法的请求控制器
func (*FasthttpServer) HandleGet ¶
func (f *FasthttpServer) HandleGet(path string, handle fasthttp.RequestHandler) *FasthttpServer
注册GET方法的请求控制器
func (*FasthttpServer) HandleNotFound ¶ added in v0.7.10
func (f *FasthttpServer) HandleNotFound(handle fasthttp.RequestHandler) *FasthttpServer
注册NotFound的请求控制器
func (*FasthttpServer) HandlePost ¶
func (f *FasthttpServer) HandlePost(path string, handle fasthttp.RequestHandler) *FasthttpServer
注册POST方法的请求控制器
func (*FasthttpServer) SetPort ¶
func (f *FasthttpServer) SetPort(port string) *FasthttpServer
设定服务端口
func (*FasthttpServer) SetServer ¶
func (f *FasthttpServer) SetServer(server *fasthttp.Server) *FasthttpServer
设定服务配置项(参数中的Handler配置项将被忽略)
type GLogCenterClient ¶
type GLogCenterClient struct {
// contains filtered or unexported fields
}
日志中心客户端结构体
日志中心见 https://github.com/gotoeasy/glogcenter
func (*GLogCenterClient) DebugSys ¶
func (g *GLogCenterClient) DebugSys(system string, v ...any)
发送Debug级别日志到日志中心
func (*GLogCenterClient) ErrorSys ¶
func (g *GLogCenterClient) ErrorSys(system string, v ...any)
发送指定系统名的Error级别日志到日志中心
func (*GLogCenterClient) FatalSys ¶
func (g *GLogCenterClient) FatalSys(system string, v ...any)
发送指定系统名的Fatal级别日志到日志中心
func (*GLogCenterClient) InfoSys ¶
func (g *GLogCenterClient) InfoSys(system string, v ...any)
发送指定系统名的Info级别日志到日志中心
func (*GLogCenterClient) TraceSys ¶
func (g *GLogCenterClient) TraceSys(system string, v ...any)
发送指定系统名的Trace级别日志到日志中心
func (*GLogCenterClient) WarnSys ¶
func (g *GLogCenterClient) WarnSys(system string, v ...any)
发送指定系统名的Warn级别日志到日志中心
type GlcOptions ¶
type GlcOptions struct { ApiUrl string // 日志中心的添加日志接口地址 System string // 系统名(对应日志中心检索页面的分类栏) ApiKey string // 日志中心的ApiKey Enable bool // 是否开启发送到日志中心 LogLevel string // 日志级别(trace/debug/info/warn/error/fatal) }
日志中心选项
type GlobalBeforeRequestHandler ¶
type GlobalBeforeRequestHandler func(ctx *fasthttp.RequestCtx) bool
全局前置拦截器
type JWT ¶
type JWT struct {
// contains filtered or unexported fields
}
JWT结构体
func (*JWT) CreateToken ¶
创建令牌(默认HS256算法)
func (*JWT) RefreshToken ¶
续签令牌(复制原令牌后创建新令牌,原令牌可以是过期令牌)
type LevelDB ¶
type LevelDB struct {
// contains filtered or unexported fields
}
LevelDB结构体
func NewLevelDB ¶
func NewLevelDB(dbPath string, opt *OptionLevelDB) *LevelDB
创建LevelDB对象,参数dbPath为数据库名目录 实际每次调用都返回同一对象,opt仅首次调用时有效,opt为nil时使用默认值
type LogDataModel ¶
type LogDataModel struct { Text string `json:"text,omitempty"` // 【必须】日志内容,多行时仅为首行,直接显示用,是全文检索对象 Date string `json:"date,omitempty"` // 日期(格式YYYY-MM-DD HH:MM:SS.SSS) System string `json:"system,omitempty"` // 系统名 ServerName string `json:"servername,omitempty"` // 服务器名 ServerIp string `json:"serverip,omitempty"` // 服务器IP ClientIp string `json:"clientip,omitempty"` // 客户端IP TraceId string `json:"traceid,omitempty"` // 跟踪ID LogType string `json:"logtype,omitempty"` // 日志类型(1:登录日志、2:操作日志) LogLevel string `json:"loglevel,omitempty"` // 日志级别 User string `json:"user,omitempty"` // 用户 Module string `json:"module,omitempty"` // 模块 Operation string `json:"action,omitempty"` // 操作 }
日志接口数据结构体
func (*LogDataModel) ToJson ¶
func (d *LogDataModel) ToJson() string
type Minio ¶
type Minio struct {
// contains filtered or unexported fields
}
Minio客户端结构体
type OptionLevelDB ¶
type OptionLevelDB struct { // 最大空闲时间(分钟,0~240),达空闲时间后自动关闭,小于等于0时不自动关闭,默认15分钟,最长不超4小时 MaxIdleMinute int }
LevelDB选项
type P2pRelayHost ¶ added in v0.9.1
func NewP2pRelayHost ¶ added in v0.9.1
func NewP2pRelayHost(key string, port string) (*P2pRelayHost, error)
新建中继P2P节点
func (*P2pRelayHost) ConnectHost ¶ added in v0.9.1
func (p *P2pRelayHost) ConnectHost(hostAddr string) error
当前节点作为客户端连接到指定节点 /ip4/{ip}/tcp/{port}/p2p/{peerid}, 或 /p2p/{peerid}
func (*P2pRelayHost) ConnectRelayHost ¶ added in v0.9.1
func (p *P2pRelayHost) ConnectRelayHost(relayHostAddr string) error
当前节点作为客户端连接到中继节点 /ip4/{ip}/tcp/{port}/p2p/{peerid}
func (*P2pRelayHost) RequestWithTimeout ¶ added in v0.9.3
func (p *P2pRelayHost) RequestWithTimeout(targetHostAddr string, uri string, dataBytes []byte, timeout time.Duration) ([]byte, error)
向目标节点发起请求并返回响应结果
func (*P2pRelayHost) SetStreamHandler ¶ added in v0.9.1
func (p *P2pRelayHost) SetStreamHandler(uri string, handler network.StreamHandler)
设定处理器
type Redis6Client ¶
type Redis6Client struct {
// contains filtered or unexported fields
}
Redis6客户端结构体
func NewRedis6ClientSentinel ¶
func NewRedis6ClientSentinel(opt *redis.FailoverOptions) *Redis6Client
创建Redis6客户端对象(哨兵模式连接)
opt.MasterName默认为"mymaster"
type SqlDeleter ¶
type SqlDeleter struct {
// contains filtered or unexported fields
}
func NewSqlDeleter ¶
func NewSqlDeleter() *SqlDeleter
func (*SqlDeleter) And ¶
func (d *SqlDeleter) And(column string, param any) *SqlDeleter
func (*SqlDeleter) Build ¶
func (d *SqlDeleter) Build() (string, []any)
func (*SqlDeleter) Delete ¶
func (d *SqlDeleter) Delete(tableName string) *SqlDeleter
func (*SqlDeleter) Eq ¶
func (d *SqlDeleter) Eq(column string, param any) *SqlDeleter
func (*SqlDeleter) Ge ¶
func (d *SqlDeleter) Ge(column string, param any) *SqlDeleter
func (*SqlDeleter) GetParameters ¶
func (d *SqlDeleter) GetParameters() []any
func (*SqlDeleter) GetSql ¶
func (d *SqlDeleter) GetSql() string
func (*SqlDeleter) Gt ¶
func (d *SqlDeleter) Gt(column string, param any) *SqlDeleter
func (*SqlDeleter) In ¶
func (d *SqlDeleter) In(column string, params ...any) *SqlDeleter
func (*SqlDeleter) IsNotNull ¶
func (d *SqlDeleter) IsNotNull(column string) *SqlDeleter
func (*SqlDeleter) IsNull ¶
func (d *SqlDeleter) IsNull(column string) *SqlDeleter
func (*SqlDeleter) Le ¶
func (d *SqlDeleter) Le(column string, param any) *SqlDeleter
func (*SqlDeleter) LeftLike ¶
func (d *SqlDeleter) LeftLike(column string, param string) *SqlDeleter
func (*SqlDeleter) Like ¶
func (d *SqlDeleter) Like(column string, param string) *SqlDeleter
func (*SqlDeleter) Lt ¶
func (d *SqlDeleter) Lt(column string, param any) *SqlDeleter
func (*SqlDeleter) NotEq ¶
func (d *SqlDeleter) NotEq(column string, param any) *SqlDeleter
func (*SqlDeleter) NotIn ¶
func (d *SqlDeleter) NotIn(column string, params ...any) *SqlDeleter
func (*SqlDeleter) NotLike ¶
func (d *SqlDeleter) NotLike(column string, param string) *SqlDeleter
func (*SqlDeleter) Or ¶
func (d *SqlDeleter) Or(column string, param any) *SqlDeleter
func (*SqlDeleter) OrEq ¶
func (d *SqlDeleter) OrEq(column string, param any) *SqlDeleter
func (*SqlDeleter) OrGe ¶
func (d *SqlDeleter) OrGe(column string, param any) *SqlDeleter
func (*SqlDeleter) OrGt ¶
func (d *SqlDeleter) OrGt(column string, param any) *SqlDeleter
func (*SqlDeleter) OrLe ¶
func (d *SqlDeleter) OrLe(column string, param any) *SqlDeleter
func (*SqlDeleter) OrLt ¶
func (d *SqlDeleter) OrLt(column string, param any) *SqlDeleter
func (*SqlDeleter) OrNotEq ¶
func (d *SqlDeleter) OrNotEq(column string, param any) *SqlDeleter
func (*SqlDeleter) RightLike ¶
func (d *SqlDeleter) RightLike(column string, param string) *SqlDeleter
func (*SqlDeleter) Where ¶
func (d *SqlDeleter) Where(column string, param any) *SqlDeleter
type SqlInserter ¶
type SqlInserter struct {
// contains filtered or unexported fields
}
func NewSqlInserter ¶
func NewSqlInserter() *SqlInserter
func (*SqlInserter) Build ¶
func (o *SqlInserter) Build() (string, []any)
func (*SqlInserter) GetParameters ¶
func (o *SqlInserter) GetParameters() []any
func (*SqlInserter) GetSql ¶
func (o *SqlInserter) GetSql() string
func (*SqlInserter) Insert ¶
func (o *SqlInserter) Insert(entity any) *SqlInserter
type SqlSelector ¶
type SqlSelector struct {
// contains filtered or unexported fields
}
func NewSqlSelector ¶
func NewSqlSelector() *SqlSelector
func (*SqlSelector) And ¶
func (d *SqlSelector) And(cond string, params ...any) *SqlSelector
func (*SqlSelector) Append ¶
func (d *SqlSelector) Append(appendSql string, params ...any) *SqlSelector
func (*SqlSelector) Build ¶
func (d *SqlSelector) Build() (string, []any)
func (*SqlSelector) Eq ¶
func (d *SqlSelector) Eq(column string, param any) *SqlSelector
func (*SqlSelector) From ¶
func (d *SqlSelector) From(table string, alias ...string) *SqlSelector
func (*SqlSelector) Ge ¶
func (d *SqlSelector) Ge(column string, param any) *SqlSelector
func (*SqlSelector) GetParameters ¶
func (d *SqlSelector) GetParameters() []any
func (*SqlSelector) GetSql ¶
func (d *SqlSelector) GetSql() string
func (*SqlSelector) Gt ¶
func (d *SqlSelector) Gt(column string, param any) *SqlSelector
func (*SqlSelector) In ¶
func (d *SqlSelector) In(column string, params ...any) *SqlSelector
func (*SqlSelector) IsNotNull ¶
func (d *SqlSelector) IsNotNull(column string) *SqlSelector
func (*SqlSelector) IsNull ¶
func (d *SqlSelector) IsNull(column string) *SqlSelector
func (*SqlSelector) Join ¶
func (d *SqlSelector) Join(table string, alias ...string) *SqlSelector
func (*SqlSelector) Le ¶
func (d *SqlSelector) Le(column string, param any) *SqlSelector
func (*SqlSelector) LeftLike ¶
func (d *SqlSelector) LeftLike(column string, param string) *SqlSelector
func (*SqlSelector) Like ¶
func (d *SqlSelector) Like(column string, param string) *SqlSelector
func (*SqlSelector) Lt ¶
func (d *SqlSelector) Lt(column string, param any) *SqlSelector
func (*SqlSelector) NotEq ¶
func (d *SqlSelector) NotEq(column string, param any) *SqlSelector
func (*SqlSelector) NotIn ¶
func (d *SqlSelector) NotIn(column string, params ...any) *SqlSelector
func (*SqlSelector) NotLike ¶
func (d *SqlSelector) NotLike(column string, param string) *SqlSelector
func (*SqlSelector) On ¶
func (d *SqlSelector) On(onCond string) *SqlSelector
func (*SqlSelector) Or ¶
func (d *SqlSelector) Or(cond string, params ...any) *SqlSelector
func (*SqlSelector) OrEq ¶
func (d *SqlSelector) OrEq(column string, param any) *SqlSelector
func (*SqlSelector) OrGe ¶
func (d *SqlSelector) OrGe(column string, param any) *SqlSelector
func (*SqlSelector) OrGt ¶
func (d *SqlSelector) OrGt(column string, param any) *SqlSelector
func (*SqlSelector) OrLe ¶
func (d *SqlSelector) OrLe(column string, param any) *SqlSelector
func (*SqlSelector) OrLt ¶
func (d *SqlSelector) OrLt(column string, param any) *SqlSelector
func (*SqlSelector) OrNotEq ¶
func (d *SqlSelector) OrNotEq(column string, param any) *SqlSelector
func (*SqlSelector) OrderBy ¶
func (d *SqlSelector) OrderBy(orders ...string) *SqlSelector
func (*SqlSelector) RightLike ¶
func (d *SqlSelector) RightLike(column string, param string) *SqlSelector
func (*SqlSelector) Select ¶
func (d *SqlSelector) Select(columns ...string) *SqlSelector
func (*SqlSelector) Where ¶
func (d *SqlSelector) Where(cond string, params ...any) *SqlSelector
type SqlUpdater ¶
type SqlUpdater struct {
// contains filtered or unexported fields
}
func NewSqlUpdater ¶
func NewSqlUpdater() *SqlUpdater
func (*SqlUpdater) And ¶
func (d *SqlUpdater) And(column string, param any) *SqlUpdater
func (*SqlUpdater) Build ¶
func (d *SqlUpdater) Build() (string, []any)
func (*SqlUpdater) Eq ¶
func (d *SqlUpdater) Eq(column string, param any) *SqlUpdater
func (*SqlUpdater) Ge ¶
func (d *SqlUpdater) Ge(column string, param any) *SqlUpdater
func (*SqlUpdater) GetParameters ¶
func (d *SqlUpdater) GetParameters() []any
func (*SqlUpdater) GetSql ¶
func (d *SqlUpdater) GetSql() string
func (*SqlUpdater) Gt ¶
func (d *SqlUpdater) Gt(column string, param any) *SqlUpdater
func (*SqlUpdater) In ¶
func (d *SqlUpdater) In(column string, params ...any) *SqlUpdater
func (*SqlUpdater) IsNotNull ¶
func (d *SqlUpdater) IsNotNull(column string) *SqlUpdater
func (*SqlUpdater) IsNull ¶
func (d *SqlUpdater) IsNull(column string) *SqlUpdater
func (*SqlUpdater) Le ¶
func (d *SqlUpdater) Le(column string, param any) *SqlUpdater
func (*SqlUpdater) LeftLike ¶
func (d *SqlUpdater) LeftLike(column string, param string) *SqlUpdater
func (*SqlUpdater) Like ¶
func (d *SqlUpdater) Like(column string, param string) *SqlUpdater
func (*SqlUpdater) Lt ¶
func (d *SqlUpdater) Lt(column string, param any) *SqlUpdater
func (*SqlUpdater) NotEq ¶
func (d *SqlUpdater) NotEq(column string, param any) *SqlUpdater
func (*SqlUpdater) NotIn ¶
func (d *SqlUpdater) NotIn(column string, params ...any) *SqlUpdater
func (*SqlUpdater) NotLike ¶
func (d *SqlUpdater) NotLike(column string, param string) *SqlUpdater
func (*SqlUpdater) Or ¶
func (d *SqlUpdater) Or(column string, param any) *SqlUpdater
func (*SqlUpdater) OrEq ¶
func (d *SqlUpdater) OrEq(column string, param any) *SqlUpdater
func (*SqlUpdater) OrGe ¶
func (d *SqlUpdater) OrGe(column string, param any) *SqlUpdater
func (*SqlUpdater) OrGt ¶
func (d *SqlUpdater) OrGt(column string, param any) *SqlUpdater
func (*SqlUpdater) OrLe ¶
func (d *SqlUpdater) OrLe(column string, param any) *SqlUpdater
func (*SqlUpdater) OrLt ¶
func (d *SqlUpdater) OrLt(column string, param any) *SqlUpdater
func (*SqlUpdater) OrNotEq ¶
func (d *SqlUpdater) OrNotEq(column string, param any) *SqlUpdater
func (*SqlUpdater) RightLike ¶
func (d *SqlUpdater) RightLike(column string, param string) *SqlUpdater
func (*SqlUpdater) Set ¶
func (d *SqlUpdater) Set(column string, param any) *SqlUpdater
func (*SqlUpdater) SetMap ¶
func (d *SqlUpdater) SetMap(m map[string]any) *SqlUpdater
func (*SqlUpdater) Update ¶
func (d *SqlUpdater) Update(tableName string) *SqlUpdater
func (*SqlUpdater) Where ¶
func (d *SqlUpdater) Where(column string, param any) *SqlUpdater
type TokenizerJiebago ¶
type TokenizerJiebago struct {
// contains filtered or unexported fields
}
func NewTokenizerJiebago ¶
func NewTokenizerJiebago(dicFile string) *TokenizerJiebago
创建中文分词器(jiebago) 参数dicFile为字典文件,传入空时默认为"data/dictionary.txt"
func (*TokenizerJiebago) CutForSearch ¶
func (t *TokenizerJiebago) CutForSearch(str string) []string
按搜索引擎模式进行分词(自动去重、去标点符号、忽略大小写)
func (*TokenizerJiebago) CutForSearchEx ¶
func (t *TokenizerJiebago) CutForSearchEx(str string, addWords []string, delWords []string) []string
按搜索引擎模式进行分词(自动去重、去标点符号、忽略大小写),可自定义添加或删除分词
func (*TokenizerJiebago) IngoreWords ¶
func (t *TokenizerJiebago) IngoreWords(str ...string)
设定忽略词(比如分词结果不想包含无效词“的”或一些敏感词时,可以这里设定)
type TokenizerSego ¶
type TokenizerSego struct {
// contains filtered or unexported fields
}
func NewTokenizerSego ¶
func NewTokenizerSego(dicFile string) *TokenizerSego
创建中文分词器(sego) 参数dicFile为字典文件,传入空时默认为"data/dictionary.txt"
func (*TokenizerSego) CutForSearch ¶
func (t *TokenizerSego) CutForSearch(str string) []string
按搜索引擎模式进行分词(自动去重、去标点符号、忽略大小写)
func (*TokenizerSego) CutForSearchEx ¶
func (t *TokenizerSego) CutForSearchEx(str string, addWords []string, delWords []string) []string
按搜索引擎模式进行分词(自动去重、去标点符号、忽略大小写),可自定义添加或删除分词
func (*TokenizerSego) IngoreWords ¶
func (t *TokenizerSego) IngoreWords(str ...string)
设定忽略词(比如分词结果不想包含无效词“的”或一些敏感词时,可以这里设定)
Source Files ¶
- ULID.go
- charset.go
- color.go
- compress_gzip.go
- compress_snappy.go
- compress_tar.go
- compress_zip.go
- data_struct_map.go
- encoding_aes.go
- encoding_hash.go
- encoding_jwt.go
- encoding_rsa.go
- event_bus.go
- exec_cmd.go
- exec_ssh_cmd.go
- file.go
- http_get_download.go
- http_get_json.go
- http_post_file.go
- http_post_form.go
- http_post_json.go
- http_post_json_fasthttp.go
- http_server_fasthttp.go
- img_blur.go
- img_bmp_to_jpg.go
- img_compress.go
- ip_city.go
- logger.go
- logger_glc.go
- middleware_ai_baidu_ocr.go
- middleware_leveldb.go
- middleware_minio.go
- middleware_redis6.go
- orm_dbhandle.go
- orm_dbvalue.go
- orm_deleter.go
- orm_inserter.go
- orm_selector.go
- orm_updater.go
- orm_util.go
- os_env.go
- os_general.go
- os_measures.go
- os_signal_exit.go
- p2p_relay_host.go
- random.go
- tokenizer_html_text.go
- tokenizer_jiebago.go
- tokenizer_sego.go
- util_converter.go
- util_date.go
- util_decimal.go
- util_general.go
- util_map.go
- util_number.go
- util_queue.go
- util_reflect_type.go
- util_string_check.go
- util_string_lcs.go
- util_string_rune.go
- win_hosts.go
- win_shortcut.go