Documentation ¶
Index ¶
- Variables
- func ComparePwd(pwd string, hash string) bool
- func EncodePWD(pwd string) (string, error)
- func ErrorCode(ctx *context.Context, code int, err error)
- func ErrorStr(ctx *context.Context, err string)
- func Errore(ctx *context.Context, err error)
- func FormatBytes(c uint64) string
- func FormatBytesSpeed(c uint64) string
- func FormatDay(sec uint64) string
- func FormatDuration(d time.Duration) string
- func FormatPercent(numerator uint64, denominator uint64) string
- func FormatSeconds(sec uint64) string
- func Get(key string) (interface{}, bool)
- func GetCurUser(ctx *context.Context) *model.Userinfo
- func GetJwtVerifier() *jwt.Verifier
- func GetSN() string
- func GetToken(data interface{}) (*model.TokenInfo, error)
- func GetTokenExpires(ctx *context.Context) time.Time
- func InitJwt()
- func Len() int
- func RandomString(length int) string
- func Set(key string, data interface{}, timeout int)
- func SetIV(data []byte)
- func Sm2GenerateKey(pwd string) (prikey []byte, pubKey []byte, err error)
- func Sm2ReadCertificateFromPem(cert []byte) *x509.Certificate
- func Sm2ReadCertificateRequestFromPem(cert []byte) *x509.CertificateRequest
- func Sm2ReadPrivateKeyFromPem(key []byte, pwd string) *sm2.PrivateKey
- func Sm2ReadPublicKeyFromPem(key []byte) *sm2.PublicKey
- func Sm3(data []byte) []byte
- func Sm3Hash() hash.Hash
- func Sm4Decrypt(key string, sec string) string
- func Sm4Encrypt(key string, data string) string
- func ToJSONString(status interface{}) string
Constants ¶
This section is empty.
Variables ¶
View Source
var JwtKey string
Functions ¶
func FormatBytes ¶
func FormatBytesSpeed ¶
func FormatDuration ¶
func FormatPercent ¶
func FormatSeconds ¶
func GetJwtVerifier ¶
func Sm2ReadCertificateFromPem ¶
func Sm2ReadCertificateFromPem(cert []byte) *x509.Certificate
func Sm2ReadCertificateRequestFromPem ¶
func Sm2ReadCertificateRequestFromPem(cert []byte) *x509.CertificateRequest
func Sm2ReadPrivateKeyFromPem ¶
func Sm2ReadPrivateKeyFromPem(key []byte, pwd string) *sm2.PrivateKey
func Sm2ReadPublicKeyFromPem ¶
Types ¶
This section is empty.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.