Categorygithub.com/ha666/golibs
modulepackage
2023.801.1500+incompatible
Repository: https://github.com/ha666/golibs.git
Documentation: pkg.go.dev

# README

#golibs

go通用库

# Packages

No description provided by the author
Goroutine池.
时间管理.
No description provided by the author
No description provided by the author

# Functions

No description provided by the author
No description provided by the author
api签名,用于开放平台.
api签名,用于开放平台.
No description provided by the author
No description provided by the author
获取url和参数列表对应的完整请求url.
字节转换成整形.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
混淆[]byte.
CreateMultiDir 调用os.MkdirAll递归创建文件夹.
No description provided by the author
No description provided by the author
格式化为Json字符串.
返回从2000-01-01 00:00:00到现在经过的纳秒数.
No description provided by the author
No description provided by the author
获取一个唯一id.
No description provided by the author
No description provided by the author
获取url对应的内容,返回信息:StatusCode,body,err.
带上AuthToken,发起一个get请求.
带上Bearer Token,发起一个get请求.
No description provided by the author
获取程序运行路径.
获取当前内网IP.
获取当前日期.
获取文件扩展名.
获取一个Guid.
获取IP地址,不包含端口号.
把IP地址转成数字.
生成随机密码,短时间内会重复.
生成简单随机密码,短时间内会重复.
获取当前时间的int64格式,yyyyMMddHHmmss.
把十六进制字符串转成字节数组.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
HomePath 获取当前用户根目录.
html编码.
判断字符串是否全中文字符 */.
是否Ascii字符.
是否email.
判断是否由汉字、字母、数字、下划线、中杠等组成.
判断是否由汉字、字母、数字、下划线组成.
是否内网IP地址.
是否IPv4地址.
判断是否由字母、数字、下划线组成.
判断是否由字母、数字、下划线组成.
是否手机号.
是否多数字(用逗号间隔).
是否数字.
判断是否标准时间格式.
判断是否是淘宝用户名(子帐号).
判断是否是淘宝用户名.
判断是否网址.
是否utf-8编码字符串.
判断是否版本号.
使用 utf8.RuneCountInString()统计字符串长度.
No description provided by the author
获取当前连接的Http方法.
NewCache returns a newly initialize cache by size.
NewCacheCustomTimer returns new cache with custom timer.
No description provided by the author
NewNode returns a new snowflake node that can be used to generate snowflake IDs.
No description provided by the author
No description provided by the author
ParseBase32 parses a base32 []byte into a snowflake ID NOTE: There are many different base32 implementations so becareful when doing any interoperation interop with other packages.
ParseBase58 parses a base58 []byte into a snowflake ID.
解析请求参数到一个url.Values对象.
No description provided by the author
No description provided by the author
Post
获取url对应的内容,返回信息:StatusCode,body,err.
PostBody
用Post方法获取url对应的内容,提交body,返回信息:StatusCode,body,err.
获取url对应的内容,返回信息:StatusCode,body,err.
带上Bearer Token,发起一个post请求,无内容.
获取url对应的内容,同时上传文件,返回信息:StatusCode,body,err.
用Post方法获取url对应的内容,提交json,返回信息:StatusCode,body,err.
带上Bearer Token,发起一个post请求,内容是json.
生成指定范围内的int64数字.
RemoveDuplicateStrings 字符串切片去重.
反转[]byte.
字符串逆序.
No description provided by the author
No description provided by the author
No description provided by the author
Since返回从t到现在经过的毫秒数.
延时delay毫秒,从t开始计时.
string().
返回当前时间字符串.
删除空格、换行、空格等字符.
字符串转成Unicode编码.
[]byte().
字串截取.
把时间字符串转成本地时间.
混淆-->base64.
混淆-->zlib压缩-->base64.
序列化为json.
序列化-->混淆-->base64.
序列化-->zlib压缩-->混淆-->base64.
No description provided by the author
整形转换成字节.
No description provided by the author
反混淆[]byte.
Unicode编码转成字符串.
返回当前时间戳(秒).
返回当前时间戳(毫秒).
返回当前时间戳(纳秒).
解压缩汉字,结果为guid或md5值.
No description provided by the author
No description provided by the author
版本号转时间,格式:2019.905.1052.
压缩md5或guid.
No description provided by the author
No description provided by the author

# Constants

ENTRY_HDR_SIZE
No description provided by the author
HASH_ENTRY_SIZE
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Variables

Epoch is set to the twitter snowflake epoch of Nov 04 2010 01:42:54 UTC You may customize this to set a different epoch for your application.
ErrInvalidBase32 is returned by ParseBase32 when given an invalid []byte.
ErrInvalidBase58 is returned by ParseBase58 when given an invalid []byte.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Number of bits to use for Node Remember, you have a total 22 bits to share between Node/Step.
Number of bits to use for Step Remember, you have a total 22 bits to share between Node/Step.

# Structs

Cache is a freecache instance.
Entry
Entry represents a key/value pair.
Iterator iterates the entries for the cache.
A JSONSyntaxError is returned from UnmarshalJSON if an invalid ID is provided.
No description provided by the author
A Node struct holds the basic information needed for a snowflake generator node.
Ring buffer has a fixed size, when data exceeds the size, old data will be overwritten by new data.
No description provided by the author

# Interfaces

timer holds representation of current time.

# Type aliases

An ID is a custom type used for a snowflake ID.