Documentation ¶
Index ¶
- Constants
- Variables
- func DesDecode(src string, key string) []byte
- func DesEncode(src []byte, key string) string
- func GetMacs(isSimple bool) (macAddrs []string, err error)
- func HmacSHA1Base64(key string, data string) string
- func HmacSHA1Hex(key string, data string) string
- func IsEmpty(arg interface{}) bool
- func IsPathExists(path string) bool
- func MD5Base64(target string) string
- func MD5Hex(target string) string
- func MachineId() string
- func PKCS5Padding(ciphertext []byte, blockSize int) []byte
- func PKCS5UnPadding(origData []byte) []byte
- func RedisGet[T any](redisClient *redis.Client, key string, beanPtr *T) error
- func RedisHashGet[T any](redisClient *redis.Client, key string, field string, beanPtr *T) error
- func RedisHashPut(redisClient *redis.Client, key string, field string, data interface{}) error
- func RedisPut(redisClient *redis.Client, key string, expire time.Duration, data interface{}) error
- func RsaDecode(str []byte, privateKey string) (string, error)
- func RsaDecodeWithPublicKey(str []byte, publicKey string) (string, error)
- func SM2DecryptHex(text string, privateKey string) (string, error)
- func SM2EncryptHex(text string, publicKey string) (string, error)
- func SM3Base64(target string) string
- func SM3Hex(target string) string
- func SM4Decrypt(data string, SM4Key string, SM4iv string) (res string, err error)
- func SM4Encrypt(data string, SM4Key string, SM4iv string) (result string, err error)
- func StructCopy(source interface{}, target interface{}, fields ...string) (err error)
- func TypeChange(source string, splitStr string) []int
- type IdWorker
- type Lic
- type PageInfo
- type Ret
Constants ¶
View Source
const ( Sm2XimiPrivateKey = "" /* 340-byte string literal not displayed */ Sm2XimiPublicKey = "MFkwEwYHKoZIzj0CAQYIKoEcz1UBgi0DQgAEX/ExHas7FvcW0G+E8ChaXoO16CwAMFb6gMn8bu97dHTjHKSTOIGbfDn0aE+eoJkU36BTtwWXgH3hvzVm4VCXog==" )
View Source
const ( // ContentTypeApplicationJson /*Content-Types*/ ContentTypeApplicationJson = "application/json;charset=UTF-8" ContentTypeFormUrlEncoded = "application/x-www-form-urlencoded" ContentTypeFormData = "multipart/form-data" // StatusSuccess Business Status StatusSuccess = 0 StatusFail = -1 // HttpHeaderXimiAccessToken http头 HttpHeaderXimiAccessToken = "X-Access-Token" // RedisIdCacheKey Redis分布式ID RedisIdCacheKey = "GO:GLOBAL:FACTOR" )
Variables ¶
View Source
var IsCheckingLicense bool = false
View Source
var PrivateKey []byte
View Source
var PublicKey []byte
Functions ¶
func RedisHashGet ¶ added in v0.2.6
RedisHashGet Redis获取(JSON序列化)
func RedisHashPut ¶ added in v0.2.6
RedisHashPut Redis保存(JSON序列化)
func RsaDecodeWithPublicKey ¶
RsaDecodeWithPublicKey RSA公钥解密
func SM4Decrypt ¶
SM4Decrypt SM4解密 传入string 输出string
func SM4Encrypt ¶
SM4Encrypt SM4加密:对称加密算法
func StructCopy ¶
StructCopy 结构体复制 source 当前有值的结构体 target 接受值的结构体 fields 需要的设置的属性
func TypeChange ¶
Types ¶
type IdWorker ¶ added in v0.2.1
type IdWorker struct {
// contains filtered or unexported fields
}
type Lic ¶
type Lic struct { Mac string `json:"mac"` Start int64 `json:"start"` End int64 `json:"end"` CustomerId string `json:"customerId"` CustomerName string `json:"customerName"` CustomerSimpleName string `json:"customerSimpleName"` ProductId string `json:"ProductId"` ProductName string `json:"ProductName"` }
Lic 授权实体
type PageInfo ¶
type PageInfo struct { PageNum int64 `json:"pageNum"` PageSize int64 `json:"pageSize"` Total int64 `json:"total"` }
PageInfo 统一报文-翻页信息
type Ret ¶
type Ret struct { Code int `json:"code"` Message string `json:"message"` Data any `json:"data"` PageInfo PageInfo `json:"pageInfo"` }
Ret 统一报文
func ErrorWithCode ¶
func SuccessWithData ¶
Click to show internal directories.
Click to hide internal directories.