package
0.0.0-20240624112235-d8775a3a5eb4
Repository: https://github.com/issueye/grape.git
Documentation: pkg.go.dev
# Functions
AddStr 组装字符串.
aes 解密.
aes 加密.
BytesToStruct 从字节转换成结构体.
CoveringUrl.
解密base64字符串.
DeleteElement 字符串切片删除元素.
EncodeMD5 md5 encryption.
加密base64字符串.
No description provided by the author
No description provided by the author
FillZero 补 0 返回字符串
value:传入值;length:总位数.
FilterNoEmptyRepeatValues 过滤切片数组中非空且不重复的值.
GenID 生成 64 位的 雪花 ID.
GetClientIp 从 gin 上下文中获取客户端ip地址.
No description provided by the author
No description provided by the author
No description provided by the author
GetTableName 获取数据库表名称.
No description provided by the author
获取程序运行目录.
InArray 判断元素是否在数组中.
No description provided by the author
InitTime 初始化时间.
No description provided by the author
IsEmptyPtr 判断字符串指针是否为空.
IsNullStr 判断字符串是否为空 "" / "null" / "nil" / "undefined".
IsStrHasAnyPrefix 判断字符串 s 是否以 prefixes 中的任意一个前缀开头.
json转为结构体.
json interface转为结构体.
ListDirEntryPathsSymlink lists all the file or dir paths in the directory recursively.
No description provided by the author
MD5V MD5 单向加密.
NewBuffer 从池中获取新 bytes.Buffer.
NewNode returns a new snowflake node that can be used to generate snowflake IDs.
NowTimePtr 获取当前时间指针.
NowTimeStr 获取指定格式的当前时间字符串.
ParseBase2 converts a Base2 string into a snowflake ID.
ParseBase32 parses a base32 []byte into a snowflake ID NOTE: There are many different base32 implementations so becareful when doing any interoperation.
ParseBase36 converts a Base36 string into a snowflake ID.
ParseBase58 parses a base58 []byte into a snowflake ID.
ParseBase64 converts a base64 string into a snowflake ID.
ParseBytes converts a byte slice into a snowflake ID.
No description provided by the author
ParseHSM 解析时分秒字符串.
ParseInt64 converts an int64 into a snowflake ID.
ParseIntBytes converts an array of bytes encoded as big endian integer as a snowflake ID.
ParseString converts a string into a snowflake ID.
No description provided by the author
补码.
去码.
PutBuffer 将 Buffer放入池中.
对数据进行解密操作.
RSADecryptAndSalt 登录密码解密加盐.
RSA加密.
生成RSA key.
从文件中读取RSA key.
No description provided by the author
sha256 哈希.
SliceContainsInt 判断 int 切片中是否包含某个值.
SliceContainsStr 判断 string 切片中是否包含某个值.
SlicePage 切片分页.
SliceRemoveInt 移除字符串型切片中的指定元素.
SliceRemoveRepeatedInt 整型切片去重.
SliceRemoveRepeatedStr 字符串型切片去重.
SliceRemoveStr 移除字符串型切片中的指定元素.
SplitNoEmptyValues 根据指定符号分割字符串,并获取分割列表中的非空值.
StrAllLetter 判断字符串是否全部是字母.
StringBuilder 高性能构建字符串工具函数.
StringUnquote 去除字符串两边的双引号.
StrPad input string 原字符串 padLength int 规定补齐后的字符串位数 padString string 自定义填充字符串 padType string 填充类型:LEFT(向左填充,自动补齐位数), 默认右侧.
结构体转为json.
结构体转为json.
结构体转结构体, json为中间桥梁, struct2必须以指针方式传递, 否则可能获取到空数据.
StructToBytes 将一个接口转换成字节.
SubStr 截取指定长度的字符串.
No description provided by the author
Unzip decompresses a zip file to specified directory.
Zip compresses the specified files or dirs to zip archive.
ZipFollowSymlink compresses the specified files or dirs to zip archive.
# Constants
日期格式:年-月-日,月日补 0.
日期格式数字串:年月日.
日期格式:年-月-日.
日期时间格式精确到分.
日期时间格式精确到毫秒.
日期时间格式数字串精确到秒.
日期时间格式精确到秒.
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 in milliseconds 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.
NodeBits holds the number of bits to use for Node Remember, you have a total 22 bits to share between Node/Step.
StepBits holds the number of bits to use for Step Remember, you have a total 22 bits to share between Node/Step.
# Structs
A JSONSyntaxError is returned from UnmarshalJSON if an invalid ID is provided.
A Node struct holds the basic information needed for a snowflake generator node.
No description provided by the author
# Type aliases
An ID is a custom type used for a snowflake ID.