Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/chanyipiaomiao/hltool
/ functions
Functions
82 in github.com/chanyipiaomiao/hltool
⨍
Functions
82
◇
Types & classes
12
↓ 6 callers
Method
logrusEntry
logrusEntry 返回logrusEntry
log.go:24
↓ 4 callers
Method
table
table 获取表 表不存在则创建
boltdb.go:37
↓ 2 callers
Function
IsExist
IsExist 文件或目录是否存在 return false 表示文件不存在
path.go:16
↓ 2 callers
Function
WriteRSAKeyPair
WriteRSAKeyPair 生成RSA密钥对
rsa.go:84
↓ 2 callers
Function
decodeBytesCreateFile
(imgbytes []byte, filepath string)
image.go:20
↓ 2 callers
Function
setNull
setNull 相当于/dev/null
log.go:158
↓ 2 callers
Function
split
(buf []byte, lim int)
rsa.go:261
↓ 2 callers
Function
toBytes
(value int64)
twofactorauth.go:19
↓ 2 callers
Function
toUint32
(bytes []byte)
twofactorauth.go:29
↓ 1 callers
Function
BytesToFile
BytesToFile 字节数组写入到文件
file.go:9
↓ 1 callers
Function
ImageType
ImageType 探测图片的类型 imgbytes 图片字节数组
image.go:16
↓ 1 callers
Function
MarshalPKCS8PrivateKey
MarshalPKCS8PrivateKey 私钥解析
rsa.go:244
↓ 1 callers
Function
QRCodeParse
QRCodeParse 二维码图片解析
qrcode.go:9
↓ 1 callers
Function
ReadRSAKeyPair
ReadRSAKeyPair 读取RSA密钥对 pubKeyFilename: 公钥文件名称 priKeyFilename: 私钥文件名
rsa.go:126
↓ 1 callers
Method
SendMessage
()
notice.go:5
↓ 1 callers
Method
Set
Set 设置值 kv 键值对
boltdb.go:55
↓ 1 callers
Function
checkSecret
checkSecret 检查输入的secret的长度是否符合base32编码规则
twofactorauth.go:35
↓ 1 callers
Function
convertSecret
(secret string)
twofactorauth.go:44
↓ 1 callers
Function
oneTimePassword
(key []byte, value []byte)
twofactorauth.go:53
↓ 1 callers
Function
oneTimePasswordSHA256
(key []byte, value []byte)
twofactorauth.go:81
↓ 1 callers
Function
pKCS7Padding
(ciphertext []byte, blockSize int)
aes.go:9
↓ 1 callers
Function
pKCS7UnPadding
(origData []byte)
aes.go:15
↓ 1 callers
Function
totpURLParse
totpURLParse totpURL解析
twofactorauth.go:110
Method
Backup
Backup 备份数据库文件
boltdb.go:149
Function
BinFileToStruct
BinFileToStruct 二级制文件反序列化为结构体,结构体必须要和转换前的结构一致 filepath 二进制文件路径 to 结构体对象 结构必须和序列化前的一样
serialization.go:28
Function
BytesToImage
BytesToImage []byte生成图片 imgbytes 图片[]byte数组 filepath 文件路径名称
image.go:36
Function
BytesToStruct
BytesToStruct []byte转换为结构体,必须事先知道结构体的结构,而且必须一样 data 转换后的字节数组 to 结构体对象 结构必须和序列化前的一样
serialization.go:56
Function
CryptPassword
CryptPassword 加密密码
secret.go:54
Function
CurrentDir
CurrentDir 获取当前路径
path.go:8
Function
CurrentUser
CurrentUser 获取当前SSH连接的用户
user.go:9
Method
Debug
Debug Debug日志
log.go:29
Method
Decrypt
Decrypt 解密数据
aes.go:46
Method
Delete
Delete 删除键值
boltdb.go:128
Method
Encrypt
Encrypt 加密数据
aes.go:32
Method
Error
Error Error日志
log.go:44
Method
Fatal
Fatal Fatal日志
log.go:49
Method
GenJWToken
GenJWToken 生成一个jwt token
token.go:20
Function
GenRandomString
GenRandomString 生成随机字符串 length 生成长度 specialChar 是否生成特殊字符
secret.go:15
Method
Get
Get 根据键名数组获取各自的值 keys 键名数组
boltdb.go:77
Method
GetAll
GetAll 获取全部
boltdb.go:102
Method
GetLogger
GetLogger getlogger
log.go:167
Function
GetMD5
GetMD5 生成32位MD5
secret.go:60
Function
GetNowTime
GetNowTime 获取当前时间
datetime.go:11
Function
GetNowTime2
GetNowTime2 获取当前时间
datetime.go:16
Function
GetNowTimeStamp
GetNowTimeStamp 获取当前的时间戳
datetime.go:21
Function
ImageToBytes
ImageToBytes 图片转换为字节数组 filepath 图片的路径
image.go:68
Function
InStringSlice
InStringSlice 元素是否在一个string类型的slice里面
array.go:4
Method
Info
Info Info日志
log.go:34
Function
IsNumber
IsNumber 检查输入的字符串是否匹配数字
number.go:8
Function
JSONBytesToFile
JSONBytesToFile json []byte 写入文件
json.go:37
Function
JSONBytesToStruct
JSONBytesToStruct json []byte 转换为 struct
json.go:28
Function
JSONFileToBytes
JSONFileToBytes 从json文件中转换为[]byte
json.go:9
Function
NewBoltDB
NewBoltDB 初始化数据库对象
boltdb.go:22
Function
NewEmailClient
NewEmailClient 返回一个邮件客户端 host smtp地址 username 用户名 password 密码 port 端口
email.go:53
Function
NewEmailMessage
NewEmailMessage 返回消息对象 from: 发件人 subject: 标题 contentType: 内容的类型 text/plain text/html attach: 附件 to: 收件人 cc: 抄送人
email.go:27
Function
NewGoAES
NewGoAES 返回GoAES
aes.go:27
Function
NewGoRSA
NewGoRSA 初始化 GoRSA对象
rsa.go:146
Function
NewHLog
NewHLog 返回HLog对象 和 error 目录创建失败
log.go:87
Function
NewJWToken
NewJWToken 创建JWToken对象
token.go:15
Function
NewRSAFile
NewRSAFile 生成密钥对文件 pubKeyFilename: 公钥文件名 priKeyFilename: 私钥文件名 kekeyLength: 密钥长度
rsa.go:26
Function
NewRSAString
NewRSAString 生成密钥对字符串 keyLength 密钥的长度
rsa.go:63
Method
Panic
Panic Panic日志
log.go:54
Method
ParseJWToken
ParseJWToken 解析 JWToken
token.go:30
Method
PrivateDecrypt
PrivateDecrypt 私钥解密
rsa.go:201
Method
PublicEncrypt
PublicEncrypt 公钥加密
rsa.go:184
Function
SendMessage
SendMessage 发送消息
notice.go:9
Method
SendMessage
SendMessage 通过钉钉机器人发送消息
dingtalk.go:24
Method
SendMessage
SendMessage 发送邮件
email.go:64
Method
SetDateFormat
SetDateFormat 设置日期格式 format "%Y-%m-%d" | "%Y%m%d"
log.go:148
Method
SetLevel
SetLevel 设置log level debug|info|warn|error|fatal|panic
log.go:129
Method
SetLogType
SetLogType 设置日志格式 json|text
log.go:111
Method
SetMaxAge
SetMaxAge 设置最大保留时间 单位: 天
log.go:117
Method
SetRotationTime
SetRotationTime 设置日志多久轮转一次 单位: 天
log.go:123
Method
SetSeparateLevelLog
SetSeparateLevelLog 设置是否分离不同级别的日志到不同的文件
log.go:153
Method
Sign
Sign 数据进行签名
rsa.go:218
Function
StructToBinFile
StructToBinFile 结构体序列化成二级制文件 structObj 结构体对象 filepath 文件路径
serialization.go:12
Function
StructToBytes
StructToBytes 结构体转换为[]byte structObj 结构体对象
serialization.go:43
Function
TwoStepAuthGenNumber
TwoStepAuthGenNumber 根据提供的 secret 来生成6位数字 返回 6位数字、剩余时间
twofactorauth.go:129
Function
TwoStepAuthParseQRCode
TwoStepAuthGenByQRCode 解析二维码图片
twofactorauth.go:151
Function
UserHome
UserHome 获取用户的家目录
user.go:15
Method
Verify
Verify 数据验证签名
rsa.go:231
Method
Warn
Warn Warn日志
log.go:39